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

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
squiddy
Posts: 16
Joined: 2018-09-27T02:53:52-07:00
Authentication code: 1152

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

Post 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)
Last edited by squiddy on 2019-01-24T04:17:35-07:00, edited 2 times in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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?
snibgo's IM pages: im.snibgo.com
squiddy
Posts: 16
Joined: 2018-09-27T02:53:52-07:00
Authentication code: 1152

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

Post by squiddy »

Damn you for pointing out my spectacular stupidity.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post by snibgo »

Tee hee!
snibgo's IM pages: im.snibgo.com
Post Reply