[Feature][ActiveStorage] add support for defining versions in models similar to paperclip

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Feature][ActiveStorage] add support for defining versions in models similar to paperclip

igorkasyanchuk@gmail.com
Hi,

I would like to add support for defining different versions of images for active storage.
Already started some development:
and it could be used like  

has_one_attached :avatar, versions: { thumb: { combine_options: {thumbnail: "500x500^", gravity: "center", extent: "500x500"} } }


is it fine? I've got a suggestion to implement it like this

has_one_attached :avatar do
  variation :thumb, thumbnail: "500x500^", gravity: "center", extent: "500x500"
end

which looks good to me.

What do you think?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Feature][ActiveStorage] add support for defining versions in models similar to paperclip

Carlos Ramirez
I think this is a useful feature to add to Active Storage

On Thursday, September 13, 2018 at 3:47:39 PM UTC-4, [hidden email] wrote:
Hi,

I would like to add support for defining different versions of images for active storage.
Already started some development:
The diff is here: <a href="https://gist.github.com/igorkasyanchuk/2775123a3fbaf196f43a092e8f4a6931" style="color:rgb(3,102,214);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:14px" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2Figorkasyanchuk%2F2775123a3fbaf196f43a092e8f4a6931\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGMcOdBWPgSBM-9sh-1lrkllZyKZA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2Figorkasyanchuk%2F2775123a3fbaf196f43a092e8f4a6931\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGMcOdBWPgSBM-9sh-1lrkllZyKZA&#39;;return true;">https://gist.github.com/igorkasyanchuk/2775123a3fbaf196f43a092e8f4a6931
and it could be used like  

has_one_attached :avatar, versions: { thumb: { combine_options: {thumbnail: "500x500^", gravity: "center", extent: "500x500"} } }


is it fine? I've got a suggestion to implement it like this

has_one_attached :avatar do
  variation :thumb, thumbnail: "500x500^", gravity: "center", extent: "500x500"
end

which looks good to me.

What do you think?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Feature][ActiveStorage] add support for defining versions in models similar to paperclip

Marcel Muller
In reply to this post by igorkasyanchuk@gmail.com
Hey there!

Did you make any progress? I'd also want to see this feature at some point, and would like to implement it. But if you are already doing so, then no reason for wasted effort from my side.

Cheers

On Thursday, 13 September 2018 21:47:39 UTC+2, [hidden email] wrote:
Hi,

I would like to add support for defining different versions of images for active storage.
Already started some development:
The diff is here: <a href="https://gist.github.com/igorkasyanchuk/2775123a3fbaf196f43a092e8f4a6931" style="color:rgb(3,102,214);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:14px" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2Figorkasyanchuk%2F2775123a3fbaf196f43a092e8f4a6931\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGMcOdBWPgSBM-9sh-1lrkllZyKZA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2Figorkasyanchuk%2F2775123a3fbaf196f43a092e8f4a6931\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGMcOdBWPgSBM-9sh-1lrkllZyKZA&#39;;return true;">https://gist.github.com/igorkasyanchuk/2775123a3fbaf196f43a092e8f4a6931
and it could be used like  

has_one_attached :avatar, versions: { thumb: { combine_options: {thumbnail: "500x500^", gravity: "center", extent: "500x500"} } }


is it fine? I've got a suggestion to implement it like this

has_one_attached :avatar do
  variation :thumb, thumbnail: "500x500^", gravity: "center", extent: "500x500"
end

which looks good to me.

What do you think?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Feature][ActiveStorage] add support for defining versions in models similar to paperclip

igorkasyanchuk@gmail.com
Hi, please implement it. Currently, I don't have enough time to work on this feature. Thanks

On Sunday, October 21, 2018 at 2:21:00 PM UTC+3, Marcel Muller wrote:
Hey there!

Did you make any progress? I'd also want to see this feature at some point, and would like to implement it. But if you are already doing so, then no reason for wasted effort from my side.

Cheers

On Thursday, 13 September 2018 21:47:39 UTC+2, [hidden email] wrote:
Hi,

I would like to add support for defining different versions of images for active storage.
Already started some development:
The diff is here: <a href="https://gist.github.com/igorkasyanchuk/2775123a3fbaf196f43a092e8f4a6931" style="color:rgb(3,102,214);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:14px" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2Figorkasyanchuk%2F2775123a3fbaf196f43a092e8f4a6931\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGMcOdBWPgSBM-9sh-1lrkllZyKZA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2Figorkasyanchuk%2F2775123a3fbaf196f43a092e8f4a6931\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGMcOdBWPgSBM-9sh-1lrkllZyKZA&#39;;return true;">https://gist.github.com/igorkasyanchuk/2775123a3fbaf196f43a092e8f4a6931
and it could be used like  

has_one_attached :avatar, versions: { thumb: { combine_options: {thumbnail: "500x500^", gravity: "center", extent: "500x500"} } }


is it fine? I've got a suggestion to implement it like this

has_one_attached :avatar do
  variation :thumb, thumbnail: "500x500^", gravity: "center", extent: "500x500"
end

which looks good to me.

What do you think?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.