user2650277 user2650277 - 1 month ago 17
Bash Question

Overwrite original image after conversion

I am using the following command to convert a tiff to a jpg.It works fine but it creates

lena512color.jpg
as expected.

gm mogrify -format jpg lena512color.tiff


I want to know what command shoul;d i use to overwrite the existing file.For e.g suppose i have a tiff named
/tmp/0303393
, i need to convert it to a jpg while still keeping name/path as
/tmp/0303393

Answer

I don't think you can do that with mogrify, you probably need convert, but either way the syntax is like this when extensions are omitted or don't correspond to formats:

gm convert TIF:/tmp/0303393 JPEG:/tmp/0303393
Comments