Author Topic: Find images that are more then 16 megapixels  (Read 153 times)

Raffie77

  • Newbie
  • *
  • Posts: 7
Find images that are more then 16 megapixels
« on: January 22, 2019, 09:43:02 AM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14436
    • ExifTool Home Page
Re: Find images that are more then 16 megapixels
« Reply #1 on: January 22, 2019, 10:37:43 AM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Raffie77

  • Newbie
  • *
  • Posts: 7
Re: Find images that are more then 16 megapixels
« Reply #2 on: January 22, 2019, 10:42:36 AM »
Hi Phil

I used this code now:

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

that works

thanks

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14436
    • ExifTool Home Page
Re: Find images that are more then 16 megapixels
« Reply #3 on: January 22, 2019, 10:44:21 AM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Raffie77

  • Newbie
  • *
  • Posts: 7
Re: Find images that are more then 16 megapixels
« Reply #4 on: January 22, 2019, 10:50:20 AM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14436
    • ExifTool Home Page
Re: Find images that are more then 16 megapixels
« Reply #5 on: January 22, 2019, 10:51:57 AM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Raffie77

  • Newbie
  • *
  • Posts: 7
Re: Find images that are more then 16 megapixels
« Reply #6 on: January 22, 2019, 10:56:17 AM »
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

  • ExifTool Freak
  • *****
  • Posts: 384
    • A selection of Alan Clifford's photographs
Re: Find images that are more then 16 megapixels
« Reply #7 on: January 22, 2019, 11:12:24 AM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14436
    • ExifTool Home Page
Re: Find images that are more then 16 megapixels
« Reply #8 on: January 22, 2019, 11:18:56 AM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).