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

fix the exif_read_data issue #36420

Merged
merged 1 commit into from
Jan 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/private/Metadata/Provider/ExifProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ public function execute(File $file): array {
// But I don't understand why 1 as a special meaning.
// Revert right after reading the exif data.
$oldBufferSize = stream_set_chunk_size($fileDescriptor, 1);
$data = exif_read_data($fileDescriptor, 'ANY_TAG', true);
$data = @exif_read_data($fileDescriptor, 'ANY_TAG', true);
Copy link
Contributor Author

@szaimen szaimen Jan 28, 2023

Choose a reason for hiding this comment

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

this was actually the only way how I could suppress the log message when testing with https://user-images.githubusercontent.com/12234510/205661916-3e7b14b4-6d4b-4dc2-9903-5265f95a2aee.png

Choose a reason for hiding this comment

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

Ok.

stream_set_chunk_size($fileDescriptor, $oldBufferSize);
} catch (\Exception $ex) {
$this->logger->warning("Couldn't extract metadata for ".$file->getId(), ['exception' => $ex]);
$this->logger->info("Couldn't extract metadata for ".$file->getId(), ['exception' => $ex]);
}

$size = new FileMetadata();
Expand Down