Page 1 of 1

convert the same image

Posted: 2007-02-07T10:24:02-07:00
by chanoy
Hi,

I'm just curious on how convert will work if I convert an image to a different location with the same extension. Will the algorithm knows that no conversion is needed, and thus just copy the file to the other location?

For example,
"convert af1.pgm ./temp/af1.pgm"

A simple test tells me that it will create the af1.pgm in temp directory, but I'm just wondering if the algorithm just do a file copy or actually "converts" it (which takes more time, more calculations, and same result)?

Thanks,
onyee

Re: convert the same image

Posted: 2007-02-07T10:31:40-07:00
by magick
If you convert an image onto itself, the convert program will read the image file and then write it back out to the same image file location.

Re: convert the same image

Posted: 2007-02-07T21:28:12-07:00
by anthony
Of course some image formats will thus change. JPEG will have some image compression degrading, PNG might be saved in a different style (basied on content), and some formats include date information.

I suggest you actually copy when you mean copy.