-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Feature request: persist image dimensions #1129
Comments
+1 |
Hi @johnnyshields ! I know this issue is a bit old (from almost 2 years ago). If this is still something you want, would you be willing to send in a PR? |
@maclover7 this is a feature request and yes it is something we should keep open. I do not have a PR currently. |
Paraphrasing @jyurek:
Closing, as he doesn't want paperclip to handle this. I would appreciate a longer description on why he thinks that way. |
@tute I think we should leave this issue open until we get a better explanation. I'm actually curious how people can live without storing the image dimensions--how do you know what size image you're going to display in advance, especially if variable dimension Rmagick settings are being used? |
I think the same! And the lack of people complaining about this seemingly for us important lack makes me think we might be missing something, or it's actually not a common use case. I'd leave it open, but we are overwhelmed with issues and PRs for now, and there's higher priority bug reports in it. I also want to hear more of @jyurek's thoughts, but knowing he doesn't consider this an issue in the library, I'm ok with leaving it closed for now, signaling it doesn't await a fix. Discussion should continue though. @johnnyshields, in the past month we've been working heavily on the issues, finding duplicates, doing code reviews, etc. We didn't find time yet to write new code though. If you'd rather have this feature in, don't hesitate to help on this work, continuing discussion of this one, and probably discussing over code, too! Specially if the addition would be small. Thanks! |
It's not something I'm immediately opposed to, but I would wonder how it's going to be implemented. The sample in the OP was that we could do However, Paperclip does already have the ability to store data in columns that may or may not exist, so this might not be as bad as I fear. Let's go with 👍, and we can discuss the specifics of the PR when it hits. Thanks, @johnnyshields |
@jyurek thanks! Will add this to our team's development queue. I use Mongoid and I store image dimensions as a Hash (which Mongoid supports natively) something like:
Then For ActiveRecord we could store the same as a JSON string which is read in using JSON.parse. Thoughts? |
Well, I'd want to let ActiveRecord handle the serialization rather than do JSON parsing ourselves, but I suppose that could work. I don't know if the serialization "just works" with Postgres' JSON or hstore columns, but that would be super nice. |
+1 to this feature. I had to create seperate columns to cache dimension as retrieving it is a rather slow operation. It would be nice the caching isbuilt in. |
It does "just work". |
Great, I think serialization is the right choice as the data is variable-length (depends on model definition of sizes) and I don't think there is any practical requirement to deep-query for specific sizes. |
That's why I was hoping that the JSON/hstore columns "just work" because you can deep query if needed. So that's awesome. |
Thank you for the feature request. Unfortunately we will be deprecating Paperclip and therefore will no longer be accepting new features. |
I imagine this topic has been raised before but...
I'd like to request to that paperclip provide a simple facility to persist image dimensions (width x height) and file size, something like the following API:
I think it's silly that I'm required to schlep around with 3rd party gems (paperclip-meta and paperclip-dimension) for what should be an out-of-the-box feature.
I would be glad to implement it if there's a willingness to include this feature.
The text was updated successfully, but these errors were encountered: