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

    (@dglingren)

    Tim,

    Thanks for the question – the short answer is yes! First, though, you need to choose between three different definitions of “image size”. The first, file_size, is how much storage the image requires, e.g., 125,000 bytes. The second, dimensions, is the width and height of the image, e.g., 1024×768 pixels. Finally, pixels is the size in pixels rather than bytes, e.g., 786,432 for a 1024×768 image. All of these are available to you.

    Columns in the Media/Assistant submenu table, or directory, come from the WordPress database. Attachments have a lot of information, such as image size and file size, that isn’t available in the standard database tables. You can pick from 53 of these additional fields and make them available by mapping them to custom fields. Here’s how it works:

    • From the admin Dashboard, scroll down to the Settings section and click the Media Library Assistant entry to open the Settings/Media Library Assistant screen
    • Click the Custom Fields tab; have a look through the instructions at the top of the screen
    • Scroll down to the “Add a new Custom Field and Mapping Rule” area
    • Enter a name for your new field, e.g., “Image Size”, in the first text box
    • Pull down the Data Source list next to the text box. Select the data you want; probably file_size or dimensions (or pixels)
    • Since this is a new field, you can leave the “Existing Text” field set to “Replace”
    • If you picked dimensions, use the Native format. If you picked file_size (or pixels), you probably want the commas format to make the column sort sensibly
    • Check the “MLA Column” box, first one to the right of “Format”. This adds the field to your directory
    • Click the “Add Field and Map All Attachments” button just below the field name text box.
    • Wait a few moments for the field to be set up and all the data filled in
    • Go back to the Media/Assistant submenu. Your new column should appear on the right-hand side of the directory. Click on the column header to sort on this field.

    There is another checkbox at the top of the Custom Fields tab, “Enable custom field mapping when adding new media”. If you leave this box checked (the default), your custom field will automatically be created for any items added to the Media Library after you created the rule.

    If the above process is unclear or if you have any trouble, let me know. You can find more information in the Documentation tab on the Settings page; look for “Custom Field Processing Options” and “Data Sources for custom field mapping” in the list of section heading links at the top of the screen.

    I hope that gets you started on adding the information you need to the directory. Thanks for using the plugin.

    Thread Starter hypergolica

    (@hypergolica)

    Dear David,

    Thank you!!! It was the image “dimensions” I was after. Your instructions worked like a charm.

    Thank you again for taking the time to spell out how to do it. I am most grateful.

    Great plugin!

    Cheers,

    Tim

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show Image Size in Directory?’ is closed to new replies.