I recently released https://www.drupal.org/project/media_entity_remote_image which seems to hit on the same need as this module, but with a focus on Media. It looks like this module hasn't been updated since 2016 so not sure if there's any chance of connecting with a maintainer, but if they see this then drop me a line.

If anybody sees features missing in Media Entity Remote Image that are present in this module, drop an issue in the queue and I'll see what I can do! Patches are welcome.

Comments

mrweiner created an issue. See original summary.

mrweiner’s picture

Issue summary: View changes
gaurav.kapoor’s picture

@mrweiner I have recently taken up ownership of this module and also pushed some patches which were posted. I have mentioned about 'Media Remote Image' module on the project page as well so that users are aware of the availability of media integration for a similar requirement.

gaurav.kapoor’s picture

Status: Active » Postponed (maintainer needs more info)
2dareis2do’s picture

If you could add a media widget for this it would be good for site editors. After all this is Drupal CMS.

I think the issue here is that media type is attached to media bundle. media_entity_remote_image does this but the problem is it is somewhat inflexible because you have to use a specific media bundle name for this e.g. remote_image. media_entity_remote_image assumes that this bundle name 'remote_image' is available. However, if you already have remote_image media bundle defined it makes it difficult to use.

This pattern is used in core as we see certain media bundles are defined there.

Furthermore, media_entity_remote_image does not use a remote stream wrapper, unlike remote_stream_wrapper module that also does similar. I understand that one difference is remote_stream_wrapper does give you the option to download the remote image and use it as an image style. Also it makes no assumptions about the name of the media bundle. That, said, unlike media_entity_remote_image it lacks the ability to add via media entity reference field or ckeditor 5 media widget.

One problem with remote_stream_wrapper is it uses the same schema as an image, and comes with the limitations of said module. e.g. I believe remote image urls are limited to 256 chars or something. url strings can and are much longer. 2,048 would probably be a better default here as this is the ie limit.

See https://stackoverflow.com/questions/812925/what-is-the-maximum-possible-...

media_entity_remote_image also addresses this by adding a new field type for remote images.

Remote stream wrapper should really be called something like HTTPReadOnlyStreamWrapper. This implements StreamWrapperInterface which is in core and also adds the ability to add remote read only images using the injected HTTPClient.

remote_stream_wrapper also requires remote_stream_wrapper_widget for remote image to be editable via the UI and,

remote_stream_wrapper also works with file_remote_image and the contributed module migrate_file which is very useful if using the migration module to import content.