ctessier / nova-advanced-image-field

🌄 📐 A Laravel Nova advanced image field with cropping and resizing using Vue Advanced Cropper and Intervention Image
https://novapackages.com/packages/ctessier/nova-advanced-image-field
MIT License
100 stars 26 forks source link

feat: adds orientable on transformable image #61

Closed rbnhtl closed 3 years ago

rbnhtl commented 3 years ago

Hi, Thanks for your package!

Images taken from a mobile device often contains exif data to store the image orientation. Uploading portrait images with orientation informations in the exif data in the advanced image field causes the image to rotate and have a black border.

This PR allows the use of intervention orientable method on TransformableImage, which takes into account the orientation stored in the exif data.

However the exif extension must be enabled on the PHP install. This code throws an exception when calling the orientable method if the extension is not loaded. I also changed the composer.json to include the exif extension in the suggest block.

Do you want me to update the readme to mention the exif package use ?

This is my first code PR, let me know if there are any problems.

eAvio commented 3 years ago

@rbnhtl Thank you very much. It looks perfect.

ctessier commented 3 years ago

Hi again @rbnhtl,

After giving it some thoughts, I understand that this feature aims at using the exif data of the image to automatically rotate the image to the right orientation. My suggestion of using the word rotatable therefore doesn't sound as appropriate as I thought.

What do you think of using autoOrientate? Otherwise, orientate can work as it is the term used by Intervention.

Thank you

sonarcloud[bot] commented 3 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

pvujic commented 3 years ago

Please add this PR

ctessier commented 3 years ago

Hi @rbnhtl

Thank you again for your work. This has been added to v1.3.0.

Have a good day Clément

(Closes #62)

shaffe-fr commented 3 years ago

Thanks @rbnhtl!