A possible workaround for issue #859 #860
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This provides a slightly more tolerant response to
allow_url_fopen
being closed on a server than throwing an exception and baling out.The proposed approach still traps for the status of the
allow_url_fopen
option, and if it is available uses the priordata://
method. If it is not available, and the source image is not a Tiff file, it writes a low quality version of the image to a temporary file on disk, and uses this as the target forexif_read_data()
and then once data is read deletes the temporary file.The code works in testing here.
Note, this approach is a demonstration of an alternative approach rather than a proposal for a definitive solution, in that it uses GD2 functions and so does not handle Tiff images. But presumably if the concept is viable the code could be generalised to work with any of the image libraries supported by Imagine.
I'm not so familiar with automated testing, so not able to provide a test for this change. Apologies.