folkloreinc / laravel-image-legacy

Image manipulation library for Laravel 4 and 5 based on Imagine (https://github.com/avalanche123/Imagine) and inspired by Croppa for easy url based manipulation (with caching)
272 stars 80 forks source link

Saving Image Doesn't Work #44

Open hlaporthein opened 6 years ago

hlaporthein commented 6 years ago

I would like to save image in a directory from public folder in laravel 5.6. So, I used the code as documentation did like below.

$orginal_path = $request->file->store( 'cropped', 'public' );

$medium = Image::make($orginal_path,array(
    'width' => 300,
    'height' => 300,
    'grayscale' => true
))->save($orginal_path);    

I added true for image.php from config directory.

'write_image' => true,

Did I miss anything?

WKoppenol commented 6 years ago

I'm experiencing the exact same issue. Everything is set up properly as far as I can tell. The library works, just the caching does not. I may dive in this later if there's no fix incoming any time soon.

Edit: I did just get something to work when supplying the write_path, but not when leaving it empty.

WKoppenol commented 6 years ago

Unfortunately I'm still experiencing issues with this. Is this project abandoned? I'm trying to use the image library for another part of my website now but it will not write images to the cache, nor will it serve the image when I tell it not to use the cache, so it seems completely broken?

Edit: For now I managed to resolve the situation by editing the library and checking the paths along the way. In the end it was because I didn't supply the correct relative path to the library to process. I'm now passing the path relative to the public folder (so images/some/folder/image.png), that'd also write the file to cache. Make sure permissions/ownership (www-data) is set correctly to the cache folders. I'd have liked if it complained a bit more if a passed URL was incorrect, I now had to dig in the library and figure out by hand step-by-step where it failed.

poldixd commented 5 years ago

any updates on your issue?

Wotuu commented 5 years ago

Unfortunately no, I've stopped using this library actively, I didn't really need it that much anyways. It's still in there but I don't think it does much anymore. Hope you get your issue sorted though! It helps to meticulously check your settings and file permissions. Good luck.