Uploading image with the crop dimensions causes an issue while accessing the image
I have followed this answer to implement the solution:
https://github.com/shrinerb/shrine/issues/124#issuecomment-269744082
and this worked well with the cropping technique.
This is the information that is stored in the metadata
> obj.logo_data['metadata']
=> {"cropping"=>{"h"=>"409.6", "w"=>"409.6", "x"=>"51.20000000000005", "y"=>"51.19999999999999"}}
accessing the attribute to get the image url caused the following:
> obj.logo
Giving a string to Shrine.uploaded_file is deprecated and won't be possible in Shrine 3. Use Attacher#uploaded_file instead.
JSON::ParserError: 784: unexpected token at '409.6'
This should have return the object like:
{:large=>#<LogoUploader::UploadedFile:0x00007ffa07808780
But I think there is some issue with the values of dimension keys in the cropping,
{"h"=>"409.6", "w"=>"409.6", "x"=>"51.20000000000005", "y"=>"51.19999999999999"}
I do not know why this problem is happening and not sure if this is the issue in the gem or jsonb column of the rails.
Ruby 2.3.5:
Shrine gem: 2.5.0:
I resolved it thanks. :)
@Sohair63 Any idea how you solved it?
@BKSpurgeon Can't remember, Probably I moved to carrirerwave gem.