Forcing imagemaigc to overwrite image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
ziasumo

Forcing imagemaigc to overwrite image

Post by ziasumo »

I want that ImageMagick should overwrite a new iamge when create without creating
imagename-0, imagename-1 ... etc
when I exeecute that command
convert old_image new_image;
new_image should create with same name no -0 prefixes..
Anyone can have any tip for this...

Thanks
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Forcing imagemaigc to overwrite image

Post by snibgo »

It will overwrite old images. It creates imagename-0 etc when you don't fully specify "crop" or whatever.

Show us the exact command you are using.
snibgo's IM pages: im.snibgo.com
ziasumo

Re: Forcing imagemaigc to overwrite image

Post by ziasumo »

This is the orignal command I am using ..I sit some psd property or what...
convert 123.psd output.jpg
ite creates
ouput-0.jpg
output-1.jpg
Even I am execting that command directly in shell command prompt.
What could be wrong..?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Forcing imagemaigc to overwrite image

Post by magick »

Your image has a layer and since JPEG can only contain 1 image, ImageMagick generates 2 with unique names. If you are not interested in the layer, try this command:
  • convert '123.psd[0]' output.jpg
ziasumo

Re: Forcing imagemaigc to overwrite image

Post by ziasumo »

Thanks for the suggestion...
It works good.
Actually I was unfamiliar with PSD format.
So it wasted my 1 hour in search of why ImageMagic creates two images with out-o.jpg and out-1.jpg from a psd file.

Thank you very much for your kind help.
Post Reply