Steps to reproduce
Create a model with an Active Storage (S3) image attachment (a .png in my case). Using the default active_storage_analysis
Expected behavior
Since all I did was call the analyze
method (which I assume is what's being called the first time around when an attachment is made), I expect it to originally have the width/height attributes.
Actual behavior
The Blob metadata is missing its width/height attributes:
#<ActiveStorage::Blob:0x00007fb934129130
id: "d6d6922a-646f-446f-8656-b1301ca5ba59",
key: "dm46dnva9crgu9k1r9y4bwmhz3oi",
filename: "Cheddah_icon-60@3x.png",
content_type: "image/png",
metadata: {"identified"=>true, "analyzed"=>true},
byte_size: 3559,
checksum: "x+EHSQeB6l3Kvb+8SCMzxg==",
created_at: Mon, 03 Jun 2019 14:56:13 UTC +00:00>
I then manually analyze the Blob by invoking the analyze
method on it. It now has the width/height:
#<ActiveStorage::Blob:0x00007fb934129130
id: "d6d6922a-646f-446f-8656-b1301ca5ba59",
key: "dm46dnva9crgu9k1r9y4bwmhz3oi",
filename: "Cheddah_icon-60@3x.png",
content_type: "image/png",
metadata: {"identified"=>true, "analyzed"=>true, "width"=>180, "height"=>180},
byte_size: 3559,
checksum: "x+EHSQeB6l3Kvb+8SCMzxg==",
created_at: Mon, 03 Jun 2019 14:56:13 UTC +00:00>
System configuration
Rails version: 6.0.0.rc1
Ruby version: 2.6.2p47 (2019-03-13 revision 67232)
Extra info
- I'm using Sidekiq
v5.2.7
- (not sure if relevant) my Variant Processor is VIPS:
image_processing (1.9.0)
mini_magick (>= 4.9.3, < 5)
ruby-vips (>= 2.0.13, < 3)
I'm aware that I can just create background jobs to do this every time the model is saved, but according to all the documentation I've been able to find, I shouldn't need to do this manually right?
Thank you for your help