Page 1 of 1
Is it possible? - The same input and output filename?
Posted: 2010-10-31T13:08:16-07:00
by Axolotl
I couldn't find how to do that. I need to convert a lot of files and i need that filenames of converted files was the same that the file from which it was converted. Is it possible?
Re: Is it possible? - The same input and output filename?
Posted: 2010-10-31T13:34:18-07:00
by fmw42
convert image1name .....options.... image1name
This will overwrite the original with all the processing done by the options and keep the same input name. If you want another name just use that for the output. But if you use the same name, the result will write over the input.
Re: Is it possible? - The same input and output filename?
Posted: 2010-10-31T14:08:01-07:00
by magick
Don't forget the mogrify program. It can perform inline image processing and replacement.
Re: Is it possible? - The same input and output filename?
Posted: 2010-10-31T17:04:20-07:00
by Axolotl
Yes, thanks. Mogrify was what i need....i was searching for some hours thru the convert's manuals, that's wy i didn't find anything
Re: Is it possible? - The same input and output filename?
Posted: 2010-10-31T17:11:06-07:00
by fmw42
Re: Is it possible? - The same input and output filename?
Posted: 2011-02-04T08:28:45-07:00
by tg3793
Axolotl wrote:Yes, thanks. Mogrify was what i need....i was searching for some hours thru the convert's manuals, that's wy i didn't find anything :D
<grrr> ... There really should be several references to mogrify in the convert's manual. ... I only searched for about forty-five minutes but it wasn't until I came across this post that I was able to start looking in the right direction.
For the benefit of others this line did exactly what I needed. It took about fifty 2meg to 3meg JPGs (in the same directory) and dropped them all down to 80 to 120 kb. And of course it left all of their names 'exactly' the same.
Code: Select all
mogrify *.jpg -quality 75 -resize "640x480>" *
And, again for the benefit of others:
*.jpg ... performs the mogrify command on all JPGs in the directory.
-quality 75 ... cuts the jpg quality down to 75% which is plenty for online viewing.
-resize "640x480>" ... causes all of the images to be resized to 640x480 (notice the ">" at the end. That makes images smaller but 'not' larger. ... and don't forget the quotes; those are important.
* ... and don't forget this at the very end of the command :-)
Re: Is it possible? - The same input and output filename?
Posted: 2011-02-06T03:23:47-07:00
by anthony
tg3793 wrote:Axolotl wrote:Code: Select all
mogrify *.jpg -quality 75 -resize "640x480>" *
That is BAD! You are not just mogrifyign each JOG you are doing so twice, plus any other image you have in the current directory!!!!
Mogrify should only list the file names to modify once, at the end.
Re: Is it possible? - The same input and output filename?
Posted: 2011-02-06T05:53:14-07:00
by tg3793
Ok, I got that string from another site and it worked so I was pretty excited about.
I'll try to fool with that a bit next time I need to use it for any reason.