Another question as I am migrating to Shrine 3…
I am using the
store_dimensions plugin on my uploader. This uploader can accept either images or videos. If the uploaded file is a video, I am generating a video thumbnail as well as some image thumbnails for it.
I want to store the dimensions of every image (original image files as well as image thumbnails from images and from videos) and it works fine, but I am getting an error when the processed file is a video:
SHRINE WARNING: Error occurred when attempting to extract image dimensions: #<FastImage::UnknownImageType: FastImage::UnknownImageType>
This is expected as
store_dimensions tried to use
FastImage to extract its dimensions . I am extracting the dimensions of the video in a separate
add_metadata block, so I would like to skip this plugin when the file is not an image.
I could silence the warning but it would also silence it for images.
As I have a custom
add_metadata block for other purposes (extracting video metadata, filtering them…) I could easily also call
extract_dimensions in it, but… this need the plugin to be loaded. So another alternative would be to be able to enable the plugin without redefining
extract_metadata, so you have access to the helper and can call it only when needed.
Any thoughts about this? I can probably submit a PR for this.