11 Replies Latest reply on Jan 26, 2017 5:45 PM by Stephen_A_Marsh

    Batch check resolution of 4K files?

    markdouglasgrant

      I have 4,000 png images that I would like to check the resolution of. (I have made all 300 ppi  by hand; I just want to see if I missed any.) Can I batch check resolution or do I have to open every file individually to check? I do not want to create an Action that re-sizes or changes anything. Thank you.

        • 1. Re: Batch check resolution of 4K files?
          Benjamin Root MVP & Adobe Community Professional

          Not on my computer at the moment, but I think you can select all the files in Bridge and it will show 300 ppi if they are all the same or -- if there is more than one value.

          • 2. Re: Batch check resolution of 4K files?
            Stephen_A_Marsh Adobe Community Professional

            I don’t believe that resolution metadata is stored in PNG metadata (I tried with both Bridge and ExifTool with both save as and save for web)… However Photoshop obviously knows once the file is open what resolution was previously set, so it must be hidden somewhere!

            • 3. Re: Batch check resolution of 4K files?
              D Fosse Adobe Community Professional & MVP

              Bridge reports ppi from PNG files:

              png.png

               

              As Benjamin says, that field will read (Multiple values) if they're not all the same.

              1 person found this helpful
              • 4. Re: Batch check resolution of 4K files?
                Stephen_A_Marsh Adobe Community Professional

                As I said, when I tested with Photoshop CS6, I did not get a resolution value from save for web – with or without metadata. I just tested save as in CS6 again and it does not include the resolution:

                 

                CS6_saveaspng.png

                 

                However I just tested in Photoshop CC2015 and a save as does include the resolution:

                 

                CC2015_saveaspng.png

                 

                However for both CS6 and CC2015, save for web does not include the resolution – whether including or excluding all metadata.

                 

                And in CC2015 the quick export to PNG does not include the resolution either.

                 

                I have inspected using Bridge CS6 and Bridge CC2015 with the same result, or lack thereof… So this would appear to be dependent on the version of Photoshop and the method of generating the PNG file.

                • 5. Re: Batch check resolution of 4K files?
                  Stephen_A_Marsh Adobe Community Professional

                  Further to my previous post, using Adobe Bridge File Info on the Photoshop CC2015 300ppi save as PNG reports:

                   

                  <tiff:XResolution>3000000/10000</tiff:XResolution>

                  <tiff:YResolution>3000000/10000</tiff:YResolution>

                  <tiff:ResolutionUnit>2</tiff:ResolutionUnit>

                   

                  And ExifTool agrees:

                   

                  [XMP-tiff]      XResolution    : 300

                  [XMP-tiff]      YResolution    : 300

                  [XMP-tiff]      ResolutionUnit : inches

                   

                   

                   

                  While for the CS6 save as PNG, there is no resolution metadata in file info or using ExifTool.

                   

                  There is consistency between Bridge and ExifTool in what they report or don’t report.

                   

                  What versions of Photoshop and what methods of saving a PNG are those using that see a resolution value reported?

                  • 6. Re: Batch check resolution of 4K files?
                    Stephen_A_Marsh Adobe Community Professional

                    markdouglasgrant, my conclusion is if there is metadata in your files for the X & Y resolution, then you can visually use Bridge or use a Bridge metadata export script and a spreadsheet (or a script to sort to folder or collection or smart collection etc) or ExifTool to report on this value.

                     

                    If your files are “blank” where this metadata tag should be, then you will likely have to use another method. If you don’t wish to use a batch action to set this 300ppi resolution value, then I would use ExifTool:

                     

                    exiftool -XMP-tiff:XResolution='300' -XMP-tiff:YResolution='300' -XMP-tiff:ResolutionUnit='inches' 'MAC OS/FILE/or/TOP LEVEL DIRECTORY PATH HERE'

                     

                    This code is formatted for the Mac OS, MS Windows users would use straight double quote marks “ and the expected \ file path formatting. This is a basic command, it is further possible to overwrite the originals instead of creating a backup _original copy of each file, and to recursively process into sub folders, to only proces specific file types and to exlude specific sub folders under the top level directory being recursively processed.

                     

                     

                    Another example, ExifTool could recursively scan a top level/sub-level directories for PNG images that were missing the resolution metadata tag and conditionally label them with an Adobe Bridge “label” marked “review” (overwriting the original files with no _original copy created):

                     

                    exiftool -r -overwrite_original_in_place -if 'not defined $XMP-tiff:XResolution' -XMP-xmp:Label='Review' 'MAC-OS/FILE/or/TOP LEVEL DIRECTORY PATH HERE' -ext .png

                     

                     

                    Or, rather than labelling the files with missing resolution metadata, these files could be conditionally processed to add in the missing metadata:

                     

                    exiftool -r -overwrite_original_in_place -if 'not defined $XMP-tiff:XResolution' -XMP-tiff:XResolution='300' -XMP-tiff:YResolution='300' -XMP-tiff:ResolutionUnit='inches' 'MAC OS/FILE/or/TOP LEVEL DIRECTORY PATH HERE' -ext .png

                    • 7. Re: Batch check resolution of 4K files?
                      Stephen_A_Marsh Adobe Community Professional

                      Enquiring minds needed to know:

                       

                      PNG Image file format

                       

                      Which appears to be backed up by saving a PNG in Apple Preview at 300ppi and inspecting with ExifTool:

                       

                      [PNG-pHYs]      PixelsPerUnitX     : 11811

                      [PNG-pHYs]      PixelsPerUnitY     : 11811

                      [PNG-pHYs]      PixelUnits         : meters

                       

                       

                      118.11 x 2.54 = 299.9994 or 300

                       

                      So it would appear that in CC Adobe hacked PNG to use the TIFF resolution specification!? Can anybody comment on what is really going on here?

                      • 8. Re: Batch check resolution of 4K files?
                        D Fosse Adobe Community Professional & MVP

                        Stephen_A_Marsh wrote:

                         

                        What versions of Photoshop and what methods of saving a PNG are those using that see a resolution value reported?

                         

                        "Save As" PNG in Photoshop CC2017 includes ppi, and it does so consistently here on a Win7 machine.

                         

                        Save For Web and Export both strip resolution metadata at all settings. That makes perfect sense of course, since PNG is specifically a format intended for web, where ppi is moot. But the format support should be there IIRC - except that png specifies resolution in pixels per cm, not pixels per inches, which sometimes causes slightly confusing rounding errors.

                         

                        PNG has always been handled differently between PS and SFW - for instance PS embeds icc profile, but SFW doesn't. There's no alternate option in either, there's no user choice at all.

                        • 9. Re: Batch check resolution of 4K files?
                          Stephen_A_Marsh Adobe Community Professional

                          So we are in agreement then, thanks for the confirmation D Fosse.

                           

                          markdouglasgrant from the consensus above, it appears that it will depend on what version of Photoshop you are using and what method to produce the PNG on whether your resolution metadata is available.

                          • 10. Re: Batch check resolution of 4K files?
                            markdouglasgrant Level 1

                            Png images created with Photoshop CC 2015. Using Adobe Bridge CC 2017 > open folder with images. Press METADATA upper right. The ppi will show in the RESOLUTION column. Thanks for help everyone.

                            • 11. Re: Batch check resolution of 4K files?
                              Stephen_A_Marsh Adobe Community Professional

                              Good for you, glad you are happy! Lucky for you that you are not using CS6 or earlier and that in CC2015 you were using save as…

                               

                              Another method would be:

                               

                              find.png