64robots / nova-image-cropper

Image Field with built-in cropper for Laravel Nova
57 stars 16 forks source link

storeOriginalName() always store 'uploaded_file.jpg' as filename #17

Closed akmalelias closed 5 years ago

akmalelias commented 5 years ago

Here is my code (same as sample in the readme.md):

ImageCropper::make('Photo') ->disk('public') ->prunable() ->storeOriginalName('photo_name') ->storeSize('photo_size') ->preview(function () { if (!$this->value) { return null; }
$url = Storage::disk($this->disk)->url($this->value); $filetype = pathinfo($url)['extension']; return 'data:image/' . $filetype . ';base64,' . base64_encode(file_get_contents($url)); }) ->aspectRatio(16/9),

Although I have use the storeOriginalName(), it keep store 'uploaded_file.jpg' as filename. How to store the original filename?

And another issue is with the same configuration, when edit the resource (Edit Form), it didn't display the stored image. It only able to display stored image in details screen. Is it a correct behaviour?

beliolfa commented 5 years ago

Fixed in 1.1.4

akmalelias commented 5 years ago

Thanks