Resize Image - Callback
See original GitHub issueThis feature request is for extension: _ (storage-resize-images
)
It would be great to see a callback included in the extension to be able to get information about the new image that has been created.
For example,
- you have the extension configured on a bucket
- you upload the original image to the bucket and await a callback
- when the new resized image has been created the callback includes information about that new image
This would make the extension more useable and make it a lot easier to know when the image has been created, and easier to go fetch it.
Thanks.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:20
- Comments:25 (9 by maintainers)
Top Results From Across the Web
Image::resize | Intervention Image v2 | intervention.io
Resizes current image based on given width and/or height. To constraint the resize command, pass an optional Closure callback as third parameter.
Read more >Image - Callbacks - Imperavi
Triggered before the image will be deleted. This callback allows you to prevent image deletion if you return false .
Read more >Resize Images | Extensions Marketplace by Firebase
Resize Images. Made by Firebase. Resizes images uploaded to Cloud Storage to a specified size, and optionally keeps or deletes the original image....
Read more >Window: resize event - Web APIs | MDN
The resize event fires when the document view (window) has been resized. This event is not cancelable and does not bubble.
Read more >resizing an image before saving in state in React
First of all your handleResize function doesn't always return value. But generally what you need to do is to use callback in your ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @ltbmedia thanks so much for this feature request!
We’ve reviewed this as a team and think that the best solution long term is better lifecycle management for an extension: a way to understand the status of an extension (when it’s executing and when it has finished) and a way to trigger an action based on a status change from an extension. We’re thinking through this problem long term and to @Ehesp’s point, this is a feature that would benefit many extensions.
Unfortunately, in the short-term, there is no easy fix for this. I’m closing this for now but we will be tracking this internally in our long term roadmaps.
Thanks again for the feedback! Kara
Hi Aliaksei, You can get the resized image by using ->
let gsReference = this.storage.refFromURL(‘gs://your-bucket-name/’ + filename + ‘_200x200’ + fileExtension)
You can only call this and get the resized image from the bucket once the resize-function has completed, otherwise you get an error because the new resized image does not exist yet - only workaround is using a delay before calling that which isn’t a great solution.
This is why we need a callback in the function to let us know that the new image exists, and has been completed. We also need the new image information so that we don’t have to string together a reference url!
Hope this helps