Page 1 of 1

default value for cli-Progs, from .rc-file or from input

Posted: 2008-10-12T09:17:11-07:00
by leonidas666
I am converting some scanned documents (.jpg) to pdf. As per the gimp, my jpgs are set to the right print-size for a4, but after

Code: Select all

convert image.jpg doc.pdf
the paper size of the resulting pdf only seems to be right if i use the -page a4 switch. Where does convert take the default paper size from (obviously not from the input image, since i set that to a4)? Is it possible to set -page a4 as a default value somewhere?
There is a similar issue with the compression of the jpg images. convert ignores the quality of the given image, and just sets some arbitrary compression value for the image in the pdf (proabably 85% or something like that). It still works if i explicitly set the compression value

Code: Select all

convert -quality 40 image.jpg doc.pdf
but it would seem to be very convenient if convert was clever enough to use the compression of the input image for the output image as well. Is this possible?

Re: default value for cli-Progs, from .rc-file or from input

Posted: 2008-10-14T21:15:18-07:00
by anthony
JPEG does not store the compression that was used by the program that saved the image, not unless that program saved it in some unique metadata profile that other programs would not understand anyway.

In fact the 'quaility' is different from JPEG implementation to implementation! As such it really has no meaning. All it is, is a basic control into the JPEG compression algorithm.

All a JPEG reader can go is make a informed 'guess' at the quality of the image read in.

IM by default just outputs at -quality 75 (or there abouts) unless changed by the user.

Re: default value for cli-Progs, from .rc-file or from input

Posted: 2008-10-15T00:21:13-07:00
by leonidas666
Thanks for the reply, anthony.

After making the post i made some research about the quality setting of jpegs, and now i realize that my question does not really make sense (because, as you said, the quality parameter differs from encoder to encoder).
But to rephrase my question, what would really be nice, if convert would just take the jpeg-data and put it into the pdf without re-compression. As i understand the picture data in the pdf is similar to the raw data in the jpeg, so that should be possible. But of course i understand that this won't go well with the process flow of convert. Anyway.

Do you have any idea about the problem with the page-size i mentioned in my first post?

Re: default value for cli-Progs, from .rc-file or from input

Posted: 2008-10-15T18:41:05-07:00
by anthony
The -page setting is a little confused as it was hijacked for virtual canvas control with layered images.

I suggest you put in a bug report about the need for -page A4 for PDF output when it probably should be default.

Maybe it is time that we properly seperated the use of page for input and output of PS and PDF files (input of TEXT files too), and the current use of it for virtual canvas (in layered images and animations).