You are not logged in.

#1 2022-11-05 21:21:13

lorenzol36
Member
Registered: 2018-10-29
Posts: 17

[SOLVED] iconv error when converting images to pdf

I'm trying to convert an image file to pdf by using the "convert" command which is part of ImageMagick. However I keep getting an error from iconv.

convert background.jpg a.pdf                                               
iconv: failed to start conversion processing
a.pdf: No such file or directory
iconv: failed to start conversion processing

Last edited by lorenzol36 (2022-11-06 11:08:40)

Offline

#2 2022-11-06 01:22:52

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,178

Re: [SOLVED] iconv error when converting images to pdf

Is your system up to date? I just tried

convert example-image.jpg example-image.pdf

using a sample image from TeX Live (2021) and it worked fine. Try passing --verbose if your system is up to date. Also try with some other image.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2022-11-06 07:40:09

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,223

Re: [SOLVED] iconv error when converting images to pdf

pacman -Qi ghostscript # optional dep for IM, probably less optional for pdf

Otherwise also check your locale

localectl
locale
locale -a

Offline

#4 2022-11-06 09:36:29

lorenzol36
Member
Registered: 2018-10-29
Posts: 17

Re: [SOLVED] iconv error when converting images to pdf

Yes, my system is up to date and ghostscript is installed. I tried with more images but the result is always the same.
These are the outputs for locale and locale -a:

C                                                                                      
C.UTF-8
en_US.utf8
it_IT.utf8
ko_KR.utf8
POSIX
zh_CN.utf8
LANG=en_US.UTF-8                                                                       
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=it_IT.UTF-8
LC_TIME=it_IT.UTF-8
LC_COLLATE=it_IT.UTF-8
LC_MONETARY=it_IT.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT=it_IT.UTF-8
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

And passing --verbose isn't helping:

convert --verbose background.jpg a.pdf                                     
uchardet: unrecognized option '--verbose'                                              
iconv: unrecognized option '--help.'
Try `iconv --help' or `iconv --usage' for more information.
iconv: failed to start conversion processing: No such file or directory
a.pdf: No such file or directory
iconv: failed to start conversion processing: No such file or directory

Offline

#5 2022-11-06 10:14:12

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,295

Re: [SOLVED] iconv error when converting images to pdf

What is the output of

which convert

Offline

#6 2022-11-06 11:08:07

lorenzol36
Member
Registered: 2018-10-29
Posts: 17

Re: [SOLVED] iconv error when converting images to pdf

Thanks a lot. You made me realize that I had a local script I made called "convert" that was interfering with ImageMagick's convert command.

Offline

Board footer

Powered by FluxBB