• Resolved steveverrall

    (@steveverrall)


    Hi,

    You have written a fantastic plugin – congratulations and thank you.

    Do you know how I can extract and display the resolution (horizontal and vertical pixel count) and size (in Kb) from a JPG file exported from Lightroom and then display it in WordPress along with the other EXIF data – ideally using your plugin?

    I have looked at files I have exported from Lightroom and I can’t see that information in the EXIF/XMP, yet I have seen other WordPress plugins find and display that information.

    I am building a stock photo site, so the resolution and file size will be relevant to any buyers of the photos.

    Steve.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author kristarella

    (@kristarella)

    Hey Steve,

    The width and height of the images are stored in the database, but the file size is not. It would need to be calculated using PHP.

    The essence of fetching this information (in case you want to look into this before I get a chance to think about putting it in the plugin) is this function:
    https://codex.wordpress.org/Function_Reference/wp_get_attachment_metadata

    If it was in the plugin do you think it would only fetch the sizes of the original uploaded images, or all the different sizes (thumbnail, medium etc)?

    Thread Starter steveverrall

    (@steveverrall)

    Hi,

    Thanks for the info. I will have a look at that function.

    Thinking further about this, I’ve realised that I will need to show only preview images in the website while storing the full resolution images somewhere like an Amazon S3 bucket. Therefore the file size and resolution of the preview in the WordPress media library would not be relevant to the end user.

    So taking that a step further I’ve used Advanced Custom Forms to create some additional meta (manually added) relating to the original, full resolution version of the file stored in S3, and then edited the product template page to display those fields.

    So in summary, I’ve realised over the past few days that I don’t need to extract that information from the (preview size) image uploaded to WordPress, either via your plugin or otherwise.

    Nevertheless, thank you again for the plugin and for getting back to me 🙂

    Cheers,
    Steve.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Finding file size and resolution’ is closed to new replies.