Find images that are more then 16 megapixels

Started by Raffie77, January 22, 2019, 09:43:02 AM

Previous topic - Next topic

Raffie77

Hi people,
I sync my photo's with google drive and I want to switch from original photo's to high quality photo's, that means if I have a photo of 16 megapixels or higher, then google makes it 16 megapixels.
I don't have much photo's that are bigger then 16mp (I think)

so is there a way to show all photo's in my photo root folder that are bigger then 15.9 megapixels, and can I output that in a list that shows the filename with full pathname and the megapixels?

regards,

Raffie

Phil Harvey

Hi Raffie,

Try this:

exiftool -q -s3 -filepath -if "$imagewidth * $imageheight >= 16000000" DIR

- Phil

Edit:  Oh, I see you also want the megapixels listed... That will take some more thought. Give me a minute.

OK.  Try this.

exiftool -p "$filepath ${imagewidth;$_*=$self->GetValue('ImageHeight');$_/=1e6}" -if "$imagewidth * $imageheight >= 16000000" DIR
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Raffie77

Hi Phil

I used this code now:

exiftool -r -n -p '${directory} ${filename} ${megapixels}' -if '$megapixels >= 16'  -ext jpg .

that works

thanks

Phil Harvey

Right.  Doh.  Forgot about the pre-defined Megapixels Composite tag.
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Raffie77

yeah someone else in this topic showed me how to do that, and I tweaked it a bit, but that message is gone apparently.

many thanks to that person who showed me that

Phil Harvey

I saw that message from Alan Clifford briefly, but he must have deleted it for some reason.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Raffie77

ok,

well thanks Alan Clifford and Phill for your very quick reaction
I'm scanning 32000 files on a external harddrive connected with USB 3
so it's gonna take a while  ;D

Alan Clifford

I posted using filesize, realized it wasn't megapixels, so deleted.

Tried again with megapixels,  the forum told me that someone had already replied, so I deleted my post, which had a later time. But it must have appeared earlier.


Phil Harvey

Well, thanks Alan.  It turned out to do the trick.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).