Skip to content
  • Hot
  • Top
  • New
3
votes

You have ... votes left in this category for this week!

completed

Add ‘portrait’ and ‘landscape’ image detection JavaScript

Dave Hilditch shared this feature

October 25, 2017

By using the External Images plugin, you forego the ability to ‘crop’ images.

This means, if you have a mix of portrait and landscape images then your product archive pages can end up looking messy.

I want to add some JavaScript and an option to the plugin to detect portrait and landscape images on archive pages, add the relevant CSS class to them and then include CSS which will automatically ensure images use the same amount of space, regardless of whether they are portrait or landscape.

 

6 Comments

  1. Roland
    October 26, 2017 @ 12:55 pm

    Nice! When you use External Images plugin it’s difficult to get the productnames on the same line. With potrait and landscape images the landscape images then overlap

    Reply

  2. veikko p.
    November 30, 2017 @ 7:18 pm

    Gave my vote! I think this functionality would serve a lot of users – as I would imagine all having to deal with this somehow who are using the plugin. I believe you would also gain quite nicely some competetive advantage over the few competing plugins with this functionality.

    Reply

  3. Anon
    January 18, 2018 @ 4:37 pm

    This has been implemented in the dev version. There are some additional options that come with including specifying the size of the ‘crop’ for the images.

    Featured images – on product detail or single post pages – are unaffected – this is for thumbnails only.

    Reply

  4. Veikko
    January 21, 2018 @ 11:15 am

    Where can I access these related settings in the WP backend? I was unable to find them. I have version 1.74 updated.

    Reply

    • Anon
      January 21, 2018 @ 11:20 am

      They’re in the dev version, not yet released, will be out today hopefully.

      Reply

  5. Anon
    January 22, 2018 @ 12:54 pm

    This has now been released. Note: In the end, I went with CSS cropping rather than JavaScript – CSS is instant on page whereas the JavaScript version meant you could see the original mess and THEN it would get tidied up.

    Reply

Leave a Reply to Roland Cancel reply

Your email address will not be published. Required fields are marked *