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 prior data:// 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 for exif_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.
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.