Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract image exif data from base64 for proper orientation value #4

Merged
merged 2 commits into from
Jun 11, 2024

Conversation

mirko-bukilic
Copy link
Contributor

No description provided.

src/Image.php Outdated
*/
private function extractExifDataAndSetOrientation()
{
if ($this->getMimeTypeFromBase64() === Consts::IMAGE_JPEG) {
Copy link
Contributor

@ppavlovic ppavlovic Jun 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this call $this->getMimeTypeFromBase64() === Consts::IMAGE_JPEG to $this->isJpeg()

src/Image.php Outdated
private function extractExifDataAndSetOrientation()
{
if ($this->getMimeTypeFromBase64() === Consts::IMAGE_JPEG) {
$this->orientation = !empty(exif_read_data($this->base64Encoded)['Orientation'])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract exif_read_data($this->base64Encoded)['Orientation'] to a variable (or exif_read_data($this->base64Encoded)) because you have a double call to exif_read_data

@ppavlovic ppavlovic merged commit 962eebf into g4code:master Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants