Posts by Jay

    Hmmm ok, most of the time I _do_ want a compressed version though since I can never rely on clients to do so.


    Good to know what I'm dealing with though—thanks.


    Someone in the Slack group suggested that I set the resize dimensions slightly off e.g. '395' rather than '400' to reduce the chances of the client uploading the correct image size.


    I'll use this tip together with an image compression library like Matt suggested.

    I can only assume this is intended behaviour but I've found that if I upload an image that does NOT need to be resized, Perch seemingly will NOT compress the image when generating a version of it.


    e.g. if I upload a file at 4000px by 1460px, and I have the Perch image tag as `<perch:content id="image" type="image" width="4000" height="1460" crop="true" quality="60" />`, Perch will simply copy and rename the image so I'll have two files that are exactly the same size:


    - some-image-w4000h1460.png (same size as `some-image.png`)

    - some-image.png


    What I would expect to happen is that Perch would compress the image while copying it, as per the quality="60" setting, so that `some-image-w4000h1460.png` would be a smaller size than `some-image.png`


    If clients upload an image at the correct size I'd like Perch to compress the image.

    Is this an oversight by any chance?

    So sorry for the delayed response—I realised I hadn't turned on email notifications for the forum!


    Thanks for the suggestions. I finally figured this out, the solution was something like:


    if($this->content['photo']['w'] > $this->content['photo']['h']) {

    return 'this is landscape';

    };


    Template filters are my favourite 'hidden' feature of Perch! So so useful.

    Is it possible to detect whether an uploaded image is landscape or portrait?


    My aim on the front-end is to change the CSS grid column span of the item if an image is 'landscape'


    I've tried using Template Filters, composite field, and even thought about using the 'output' attribute of an image but I'm not sure it's possible.

    My best guess was to use the 'Accessing content' part of Template Filters but I'm not sure it's possible to _just_ access the width or height attributes of an image field.

    It would be great if Runway search performed a bit better.


    A specific suggestion I have is around numbers — I discovered that Runway does not return any results from a collection where I'm searching for an item that is simply named as a number.

    I've attached a real-life screenshot below where I have flooring samples which are named by an ID number.


    When searching for '715' this does not bring up any results in Runway's admin search.

    I believe this is because there are no letters in the name, for example if I rename '715' to '715 test' and search for 'test', the result shows up.