Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Multiple image handling: profiles
philwareham wrote #325162:
Intervention Image then makes a series of duplicated copies of that image based on user-defined size settings (or a default set if user hasn’t changed profiles from what we set at installation).
Yes, or we write a cunning wrapper around Intervention’s API to offer on-demand resizing and caching to either the local image store or cloud/CDN service. In other words, do something along the lines of what slir does but we control what parameters are exposed and how the resulting images are named/referenced.
I’ve not delved into all the stuff that Intervention offers yet. But I can see something like I posited earlier of using <txp:images> to first ask for the cached version of any requested image and, if it’s not there, generate it on-the-fly and cache it. Depends largely on performance as we test this.
Core’s Images panel would/could do exactly the same process so we don’t need to make pre-defined versions “just in case”. We make one size (the dimensions of which we hardcode in core as appropriate) based on whether the user is viewing grid or list. If they switch, we generate another size at that time to support that view.
Worst case scenario is that we generate 96 images in one go if you flick from list to grid with max paging (I suppose there could be more if a plugin has extended this max value). But I’m interested to know how lazy loading interacts with Intervention. Since we now only fetch images as the user scrolls, that might mean we can generate/cache them as people scroll too, which cuts down on the processor load of generating them all at once. Of course, once generated, then it’s just a cache read so it’s a one-off process per page of results.
Lots of fun to be had here.
Last edited by Bloke (2020-08-05 10:00:09)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: Multiple image handling: profiles
Is PHP Tinify library third-party dependent? It seems to me API only is, although I am not a programmer, sorry. Its PHP code is published on GitHub.
I don’t think Panda holds some monopoly for quantization techniques — Cloudinary works in similar way. Maybe PHP GraphicsMagick module is also capable to quantize graphics?
Weired, I do not know any similar desktop app. I mostly use PNGOUT and RIOT (Radical Image Optimization Tool) plug-ins for IrfanView — both work fine, but only degrading image quality.
Last edited by Vienuolis (2020-08-05 10:15:20)
Offline
Re: Multiple image handling: profiles
Vienuolis wrote #325165:
Is PHP Tinify library third-party dependent?
Yes. You install the PHP library as a convenience to access their online service. And you need an API key to do so, which is an additional user hurdle.
I do not know any similar desktop app.
Although it doesn’t optimize per se, even Mac’s built-in Preview application does a wickedly good job at resizing images and retaining quality – it far outstrips GD’s attempts.
And if you want to squeeze more bytes out without altering quality, there’s Exifpurge which strips out all the junk camera metadata (assuming you’re not using it for cataloguing purposes!).
Last edited by Bloke (2020-08-05 10:23:50)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: Multiple image handling: profiles
I am a bit baffled about the stance here, I must admit – I get that there’s a need for optimisation…but how did we get from “much better image handling” to “farming out files to and fro to an optimisation-as-a-service platform” so quickly?
Online
Re: Multiple image handling: profiles
Vienuolis wrote #325165:
I do not know any similar desktop app.
There’s ImageOptim if you have a Mac: imageoptim.com/mac and some alternatives if you don’t.
Edit: oh, and there are command line versions of ImageMagick and GD so if you can get the settings you want then perhaps that might be worth a try?
Last edited by gaekwad (2020-08-05 10:38:16)
Online
Re: Multiple image handling: profiles
I have FileOptimizer app mentioned there, and PngQuant as a plugin — far to Tinify, do not worth attention. I am afraid ImageOptim, too.
Offline
Re: Multiple image handling: profiles
OK, so we’ve covered optimisation now. Going back to the image handling, I think we have a pretty clear route forward – thanks everyone!
Offline
Re: Multiple image handling: profiles
Been playing with some layout for potential new editing features that would be possible in the image manipulation libraries we are thinking of using: design-patterns.textpattern.com/mockups/secondary/content-image_edit-proposal.html
Offline
Re: Multiple image handling: profiles
philwareham wrote #325224:
Been playing with some layout for potential new editing features that would be possible in the image manipulation libraries we are thinking of using: design-patterns.textpattern.com/mockups/secondary/content-image_edit-proposal.html
Nice! And much needed. 👍
One thing that could be useful is to mark the focal point of an image when using it with object-fit. Perhaps that’s plugin-territory, but it should be addable.
TXP Builders – finely-crafted code, design and txp
Online
Re: Multiple image handling: profiles
Focal point cropping is available in the tool we are hoping to use. Not sure that is exactly what you mean though.
They use the same suite of tools in Statamic.
Offline
Re: Multiple image handling: profiles
Ah, I meant object-position: See this css-tricks articles. It allows you to specify where the centre point of the image should be when using a responsive container not of the same aspect ratio as the image.
TXP Builders – finely-crafted code, design and txp
Online
Re: Multiple image handling: profiles
That’s a presentational item – not really part of the content – so I doubt it (not in core anyway).
Offline
Re: Multiple image handling: profiles
Some CMSes (don’t have an example to hand) have a crosshair that you place on the image and saves the focal point with the image data.
philwareham wrote #325237:
not in core anyway …
Yes, that may be plugin territory. It would entail adding a crosshair button and the corresponding position marked on the image.
TXP Builders – finely-crafted code, design and txp
Online
Re: Multiple image handling: profiles
Our content is totally abstracted from presentation (CSS), so I’m unsure how you could achieve that within our model (apart from via inline styles which I want to avoid).
Offline