prestashop
prestashop copied to clipboard
allow upload of local images
AFAIK now open-uri uses simple paths /some/path/image.jpg for local files.
And that's why this check prohibits the upload of local images https://github.com/werein/prestashop/blob/master/lib/prestashop/mapper/models/image.rb#L32
Yes, we are uploading only remote files, but that shouldn't be problem to add this functionality
Should we just get rid of the URI check and pass it directly?
I'd suggest to make the check more sophisticated otherwise it may fail, when the path doesn't exists.
You want to check if it's a path or a URL - and if it's a path check for existence?
I would have delegated this further down the to the underlying (MiniMagick) implementation. That should give an error we can just catch.