Menu

detecting corrupted images in a folder and its subfolders

2019-06-28
2019-07-09
  • luigi bettelli

    luigi bettelli - 2019-06-28

    Hello.

    I need to find all the corrupted images in a folder and its subfolders.

    Trying
    exiftool C:\Users\xxx\Desktop\image_1.jpg

    on one of these images, I get

    File Type Extension : eps

    and I don't get
    Image Width
    Image Height
    Image Description

    Is there a way (from command line or also in another way) for finding out all the images that will have the same problem?

    Thanks!
    Luigi.

     
  • Phil Harvey

    Phil Harvey - 2019-06-28

    exiftool -filename -if "not $imagewidth" DIR

     
  • luigi bettelli

    luigi bettelli - 2019-06-28

    Thanks!
    And you know how to scan all the jpg files in all C:\Users\xxx subfolders?
    Cause If I write
    exiftool -filename -if "not $imagewidth" C:\Users\xxx\Desktop*.jpg

    it checks only the jpg files under C:\Users\xxx\Desktop...

     

    Last edit: luigi bettelli 2019-06-28
  • luigi bettelli

    luigi bettelli - 2019-06-28

    Ah I think I found out:
    exiftool -filename -if "not $imagewidth" -r -ext jpg C:\Users\xxx\Desktop\

     
  • luigi bettelli

    luigi bettelli - 2019-07-08

    Hi again!
    So I've manage to have it working with this script:

    exiftool -filename -if "not $MIMEtype =~ /image/" -if "$filename =~ /(jpg|jpeg|tif|png|gif)/" -r G:\aaaa\bbbb\cccc\ > C:\Users\yyyy\image_list.txt

    The (small) problem is that this writes something like:

    ======== G:/aaaa/bbbb/cccc/xxxx.jpg
    File Name : xxxx.jpg

    While I'd be fine with just
    ======== G:/aaaa/bbbb/cccc/xxxx.jpg

    How should I write the code for having only that line?
    I've tried omitting the '-filename', but then I get all the info for every images...

    Thanks!

     
  • StarGeek

    StarGeek - 2019-07-08

    Put in a non-existent tag name, for example -AAA. That will list files that meet your -if statement criteria, but have no output other than the file name header.

     
  • luigi bettelli

    luigi bettelli - 2019-07-09

    Oh thatìs clever, thanks!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.