silverstripe-asset-admin icon indicating copy to clipboard operation
silverstripe-asset-admin copied to clipboard

Allow custom dimensions without ratio binding in "insert media"

Open flamerohr opened this issue 9 years ago • 7 comments

Acceptance Criteria

  • As a CMS author I can opt out of the default ratio binding of dimensions in the "insert media" and "insert image" modals

Notes

  • Based on the InsertMediaModal work here https://github.com/silverstripe/silverstripe-asset-admin/pull/307

flamerohr avatar Nov 21 '16 00:11 flamerohr

The "keep ratio" feature already exists in "insert media" and "insert image", so the ACs are confusing. Removed the following AC:

Dimension ratios could be kept and updated as the user updates one of the dimensions of an image in the "insert media" modal

chillu avatar May 07 '17 21:05 chillu

Pointer for how to approach this: Check out the ProportionConstraintField component in asset-admin. Currently it has an active property, which will need transferring to either a redux state or react component state (either is fine, brownie points for redux state) Then it will require a button or other interface to toggle the active property to turn on or off the constraint.

flamerohr avatar May 18 '17 10:05 flamerohr

I can't think of a common use case for changing the aspect ratio of an inserted image (it'll always distort its contents). I bet there are some, but that signals to me that it's not a beta2 issue - removing milestone

chillu avatar Jul 04 '17 23:07 chillu

@chillu here's a good counter-argument; Sometimes the width is known, but the height is guessed. In this case, we need to allow the user to either leave this blank (it'll auto-size) or specify a known height.

See https://github.com/silverstripe/silverstripe-cms/issues/1921 for reference.

tractorcow avatar Aug 09 '17 22:08 tractorcow

This issue (or something like it) seems to be affecting 4.4.4.

  • Hit "Insert Media"
  • Paste this YouTube URL: https://www.youtube.com/embed/hwe3nwiAptY
  • Observe default width (480) and height (270) is shown
  • Try to adjust it to 650 x 366 (It's also a bit fiddly becuase the text-input area's JS prevents users from deleting the last digit)
  • HIit the "Insert Media" button again
  • Save the page
  • Review the frontend, and inspect the generated

phptek avatar Dec 11 '19 23:12 phptek

This issue is still happening. I have created the youtube link and tried to set it to 640 x 330. After saving the change, the iframe still has default dimensions width="480" height="270". One thing I noticed is the parent div thumbnail render style="width: 640px;". If it also has the height in the styling, the issue can be solved.

ngaplastyk avatar Apr 23 '20 06:04 ngaplastyk

A little late, but the points made in the last two comments relate to the following open issue: https://github.com/silverstripe/silverstripe-framework/issues/8251

brynwhyman avatar Apr 29 '20 00:04 brynwhyman