Follow-up to #2770761: Derivatives should not be created on read-only stream wrappers, for backporting from 8.x to 7.x
Problem/Motivation
If the source image is passed as a stream wrapper, image_style_url()
creates the destination on the same stream wrapper. This is fine for public://
and private://
and even for any writable custom stream wrapper. But when it comes to build a derivative from a read-only stream wrapper, Drupal cannot write there because it's simply... READONLY.
This is somehow related to #987846: Switching file storage to anything other than public/private breaks image styles but is not the same in the sense that D8 allows creation of derivatives from sources passed as stream wrappers but will fail to create the files on read-only wrappers.
Proposed resolution
When the source image is passed as a read-only stream wrapper, set the derivative scheme to the default scheme.
Remaining tasks
tbd
User interface changes
None.
API changes
None.
Data model changes
None.
Comments
Comment #2
mondrake