Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store dimensions of image #165

Open
flyingL123 opened this issue Aug 9, 2016 · 0 comments
Open

Store dimensions of image #165

flyingL123 opened this issue Aug 9, 2016 · 0 comments

Comments

@flyingL123
Copy link

It would be great if there was a way to store the actual dimensions of each image style in the database. Maybe we can add a column called {attachment_name}_dimensions, and save a serialized array representing the physical sizes for each style, for example:

['zoom' => ['width' => 1280, 'height' => 1000], 'thumbnail' => ['width' => 100, 'height' => 63]]

The image dimensions are required to use the great photoswipe.js library. I managed to implement this myself in a project using a very less-than-ideal workaround involving a direct database right of the dimensions inside the closure defining the style. I was unable to find a better way since there are no events that fire during the image processing process, which means there was no way to hook into it and store the dimensions.

It would be really great to have the library store these dimensions automatically by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants