Page 1 of 1

Using mogrify to make thumbs from jpg - 2 files being created [RESOLVED]

Posted: 2019-01-23T05:07:14-07:00
by squiddy
UPDATE:
Let this question be a dire warning to she or he who would post a query without first checking every obvious cause of an apparent error

Version: ImageMagick 6.9.10-14 Q16 i686 2018-11-10
Features: Cipher DPC OpenMP
Delegates (built-in): bzlib fontconfig freetype jbig jng jpeg lcms lqr lzma pangocairo png tiff wmf x xml zlib
32-bit Linux


I followed Anthony Thyssen's example here to try and generate a set of thumbs from a bunch of jpgs from my 'phone.

The jpgs are all in subdirs named per date of capture.
The thumbs are being created in separate subdirs with identical names except of course for the extension.
Thus thumbs for ~/Phone/20180114/*.JPG will be created in ~/thumbs/20180114/

The command I used is as follows:

Code: Select all

 for i in * ; do mogrify  -format png  -path ../thumbs/$i -thumbnail 256x348 $i/*.JPG ; done
However this creates two files from each original in the target directory, thus:
20180114-DSC_0277-2.png
20180114-DSC_0277.png

are both created from 20180114-DSC_0277.JPG

The two thumbs are functionally identical, though they are all a few bytes different in size - literally 2-5 bytes different

Note that this isn't just these two particular files - it happens for every file in every subdir.
I am, therefore, confused.

What do I need to do (apart from rm) to generate these without dupes using mogrify?
(I realise I can do this whole task in other ways, so don't need advice on that front)

Re: Using mogrify to make thumbs from jpg - 2 files being created

Posted: 2019-01-23T20:07:43-07:00
by snibgo
I can't see why your command would create two outputs for every input. When IM does that, it names them with -1 and -2 suffixes, rather than one with no suffix and the other with -2 suffix.

Please check your input directories carefully. Do any files there have the suffix -2?

Re: Using mogrify to make thumbs from jpg - 2 files being created

Posted: 2019-01-24T03:46:59-07:00
by squiddy
Damn you for pointing out my spectacular stupidity.

Re: Using mogrify to make thumbs from jpg - 2 files being created [SORRY, "FAKE NEWS"]

Posted: 2019-01-24T06:10:54-07:00
by snibgo
Tee hee!