[MGNLIMG-169] Provide image resizing possibility without a theme Created: 12/Aug/15  Updated: 03/Sep/20

Status: Open
Project: Imaging
Component/s: tools
Affects Version/s: 3.2
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Christian Ringele Assignee: Unassigned
Resolution: Unresolved Votes: 4
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to MGNLSITE-100 Missing Imaging configuration can lea... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

Currently the only way to get resized images is via imaging rules defined in a theme:
-> renditions of the DamTemplatingFunctions
-> variations of the ImagingTemplatingFunctions

This means that the template needs a site and a theme in use.
But a site & theme is only available for the "site" page templates, not the "freemarker" templates.

So for pure "freemarker" templating, there is currently no way of requesting different image sizes.
Means that pure front end templaters using for example light modules & freemarker templates can't get resized images.

It should provide something very simple, as any other CMS does:

${imgresizefn.resize(Asset asset, String width, String height)}
${imgresizefn.resize(Asset asset, String width)}
${imgresizefn.resize(Node binaryNode, String width, String height)}
${imgresizefn.resize(Node binaryNode, String width)}


 Comments   
Comment by Tomáš Gregovský [ 09/Feb/16 ]

I like and support this idea - easier then using image variations (complicated to explain, need to configure on multiple locations, not all of them via yaml).

Instead of new function it can be add to already existing imgfn, and if there will be also option to crop:true/false then it will be nice front-end improvement.

Thanks!

Comment by Christopher Zimmermann [ 02/Sep/20 ]

This is also an issue for headless usecases. 
Perhaps we should introduce support for getting renditions soley based on URL parameters.

Comment by Richard Gange [ 03/Sep/20 ]

If we did implement this feature we should also look into a way to avoid MGNLSITE-100.

It would be convenient if I could create an asset rendition by simply passing in a number and not have to declare that number in a file.

If I pass the variation name "240" then I get a square 240 back.
If I pass the variation name "240x360" then I get width=240 height=360 (or vice versa)

Generated at Mon Feb 12 02:12:57 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.