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

Avoid using 2.3x the image size worth of memory when no memory is enough #479

Merged
merged 1 commit into from
Mar 5, 2016

Conversation

Seldaek
Copy link
Contributor

@Seldaek Seldaek commented Feb 4, 2016

exif_read_data can read from the filesystem just fine, so if we get an image path, doing file_get_contents() will load up the file in memory, and then passing it to doReadData will base64_encode it which typically adds 1/3rd of the binary size to the output, so you add 1.3x the image size into the memory.

This is all fine with thumbnail sized images but when dealing with large files you very easily and unnecessarily blow up the memory limit.

There is no 0.6 branch but this applies cleanly on 0.6.3 as well, in case you'd like to do a new release :)

@Seldaek Seldaek force-pushed the large-file-support branch from b3169f8 to f5f3028 Compare February 4, 2016 18:11
@Seldaek
Copy link
Contributor Author

Seldaek commented Feb 13, 2016

@romainneutron just so I know are you still maintaining this or is it completely abandoned? :)

@romainneutron
Copy link
Collaborator

@Seldaek Sorry for the late reply. Thanks for this !

romainneutron added a commit that referenced this pull request Mar 5, 2016
Avoid using 2.3x the image size worth of memory when no memory is enough
@romainneutron romainneutron merged commit effe212 into php-imagine:develop Mar 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants