Postponed (maintainer needs more info)
Project:
Picture
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Jan 2015 at 14:12 UTC
Updated:
18 Mar 2024 at 16:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
kjauslin commentedAttached patch fixes resizing. It limits the colorbox container size to the main window (respecting also the drupal colorbox maxWidth/maxHeight configuration variables).
Comment #2
attiks commentedComment #3
greenskin commentedIt's scaling correctly, for the most part, on the first view. But subsequent views (without refresh) the images are larger than the window again. There's also a bit of a flash of the larger size before it's initially scaled down.
Appears like the 'cbox_load' event is only triggering the initial time.
Comment #4
attiks commentedComment #5
johnny5th commentedI show this to be working after flushing server and local caches.
EDIT: I take that back. It seems that the code calling the resize isn't being fired every time the cbox comes up. Taking a crack at resolving.
Comment #6
maen commentedHere my 2 Cents for the resizing problem.
Comment #7
michael dajewski commentedI am trying to achieve simple case where, opened colorbox uses picture element so the image size can be optimised for screen size. Configuration:
Added two breakpoints:
- tablet (min-width: 768px)
- mobile (min-width: 0px)
All default settings except I did configure ‘Picture polyfill to use’ to be ‘Development polyfill’ so I I could load non-minified version of picture.js
Added two mappings:
- ‘Device mapping’ which uses ‘Device screen’ (see 4 above)
- ‘Fixed size’ which uses ‘Fixed size’ (see 4 above)
Library version: 1.6.4
- Format: Picture
- Picture mapping: ‘Fixed size’ (see 5 above)
- Colorbox picture mapping: ‘Device mapping’ (see 5 above)
I started digging in the issue and found few problems:
Attaching patch to address above problems: picture-lazyload-resizing-2412249-2.patch
Maybe there is nicer and/or cleaner way to resolve above.
We could create another issue or three issues to address all separately, but I have feeling it would only complicate the things and we would be waiting long time for resolution.
Comment #8
mmncs commented#7 Worked for me. Thanks Michael!
Comment #9
mmncs commentedI added the following so images don't expand beyond their natural width if they are smaller than screen size.
Comment #10
michael dajewski commented@mmncs thanks you.
Did not test the case.
I did found I did not set correctly image size.
We need to get interface height and width.
Adding new picture-lazyload-resizing-2412249-3.patch
Comment #11
mmncs commentedI will have a look at the new patch and test it.
I can tell you that patch #7 cut's of the bottom of the image of and doesn't work the first time fired in Firefox.
Comment #12
raywalters commentedThe 2412249-correct-resize.patch #6 worked for me by correctly resizing the colorbox. I chose this one because I was not seeing the images in carousels when clicking on them for the colorbox. This one also resized the colorbox to the window and didn't restrict the colorbox size.
Comment #13
lesleyfernandes commentedAfter 8 years, is anyone still using these patches, or need this ticket to be completed?
Comment #14
quotesbro commented@lesleyfernandes yes, I am using #10, that worked for me.
Comment #15
steinmb commentedAfter 9y do I think we can unassign.