Closed (fixed)
Project:
Consumer Image Styles
Version:
4.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Jul 2019 at 13:44 UTC
Updated:
20 Jul 2023 at 21:50 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
garphyHere's a first attempt to add
width&height.Comment #3
garphyThis new patch adds derivative dimensions (width & height) to file entity links built by
LinkCollectionNormalizer.Comment #4
Kojo Unsui commentedVery useful patch !
Applied smoothly on Drupal 9.1.7 with PHP 7.4.13.
Here is a related snippet of JSON:API Resource after applying #3 :
So far so good. Thanks !
Comment #6
bradjones1I think this will also require an update to the enhancer's schema - see #3202870: Fix JSON schema for image style enhancer
Comment #7
bradjones1I am overriding various classes in the image style generation pipeline so not using this patch directly, but I think the approach is correct. I will update the schema issue, referenced above.
Comment #8
rrrob commentedThis patch works great. Switching version to 4.x.
Comment #9
rrrob commentedHere's a reroll to work on 4.x.
Comment #10
rrrob commentedTests for 4.x need to be enabled.
Comment #11
e0ipsoComment #12
e0ipsoAdded some minor tweaks.
Comment #13
e0ipsoMind that in the final version the dimensions are now nested into the 'meta', that was the only option allowed by https://jsonapi.org/format/1.1/#document-links-link-object
I wish LinkCollection was more usable so we could leverage it and the serialization component.
Comment #15
e0ipsoComment #16
bradjones1Prior art re: #13 on the Link Collection: https://git.drupalcode.org/project/jsonapi_hypermedia/-/blob/8.x-1.x/src...
Comment #17
osopolarPlease see #3240536: Missing image causes type error. May we undo these changes for now?
Comment #19
jsacksick commentedNote that this introduced a serious "bug" described in #3252023: Very slow JSON:API responses when images are stored on AWS bucket.
Comment #20
tjh commentedWith this change effectively reverted due to the "bug" described in https://www.drupal.org/project/consumer_image_styles/issues/3252023, what would be a more correct way to include the values of the derived image dimensions?