prestashop icon indicating copy to clipboard operation
prestashop copied to clipboard

allow upload of local images

Open tcurdt opened this issue 9 years ago • 4 comments

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

tcurdt avatar Nov 15 '15 14:11 tcurdt

Yes, we are uploading only remote files, but that shouldn't be problem to add this functionality

jirikolarik avatar Nov 17 '15 17:11 jirikolarik

Should we just get rid of the URI check and pass it directly?

tcurdt avatar Nov 17 '15 20:11 tcurdt

I'd suggest to make the check more sophisticated otherwise it may fail, when the path doesn't exists.

jirikolarik avatar Nov 17 '15 21:11 jirikolarik

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.

tcurdt avatar Nov 17 '15 21:11 tcurdt