1
votes

I'm trying to use ImageMagick for compressing images on my web-site. I've found a nice algorithm, implemented it, but getting error: "mogrify: unable to open image `thumb_preview_uVACfM5fhbE87num1fYGlQsmall.jpeg': No such file or directory @ error/blob.c/OpenBlob/2695." Seems that I'm missing something, but can't figure out what exactly. Here's the command (i split it on several lines):

 mogrify 'uploads/images/preview_uVACfM5fhbE87num1fYGlQsmall.jpeg'
 -path uploads/images -filter Triangle -define filter:support=2 
-thumbnail 100 -unsharp 0.25x0.25+8+0.065 -dither None -posterize 136 
-quality 82 -define jpeg:fancy-upsampling=off 
-define png:compression-filter=5 -define png:compression-level=9 
-define png:compression-strategy=1 -define png:exclude-chunk=all
 -interlace none -colorspace sRGB 
-strip thumb_preview_uVACfM5fhbE87num1fYGlQsmall.jpeg
1
Do you have a file with that name? - Mark Setchell
@MarkSetchell no, I want the output file to have that name - poctek

1 Answers

2
votes

When you use mogrify, it uses the same output filename as input filename - i.e. it overwrites the input file. As such, your command is looking for thumb_preview...jpeg as an input file whereas you want it to use that as the output file.

You need to replace mogrify with convert and then the last filename will be interpreted as an output filename.

convert inputfile.jpg ... operations ... outputfile.jpeg