javascript - Angular - Generate thumbnails for uploaded imagevideo - Stack Overflow

I have an Angular application where a user can upload files. I want to generate a thumbnail image for f

I have an Angular application where a user can upload files. I want to generate a thumbnail image for files that are images/videos. Basically, all I have is the file bytes and type, I do not save the file in the app, I just forward it to another API. I don't want to save the generated thumbnail locally, I just want to forward it along with the original image/video.

I've found the package simple-thumbnail but I see that it requires either the file path (which I don't have since I do not save the file in my app) or the image URL (which also I don't have since the user upload the image from his puter). Also, this library saves the file, which I don't want.

Is there any way to generate an image thumbnail out of image/video bytes, only to forward it further along with the original file?

I have an Angular application where a user can upload files. I want to generate a thumbnail image for files that are images/videos. Basically, all I have is the file bytes and type, I do not save the file in the app, I just forward it to another API. I don't want to save the generated thumbnail locally, I just want to forward it along with the original image/video.

I've found the package simple-thumbnail but I see that it requires either the file path (which I don't have since I do not save the file in my app) or the image URL (which also I don't have since the user upload the image from his puter). Also, this library saves the file, which I don't want.

Is there any way to generate an image thumbnail out of image/video bytes, only to forward it further along with the original file?

Share Improve this question asked May 20, 2022 at 9:10 Radu HrihoreanuRadu Hrihoreanu 3843 silver badges17 bronze badges 0
Add a ment  | 

1 Answer 1

Reset to default 4

You can try to create a video element and set your video to it. After loading the video inside the element a canvas can be used to extract an image from that video. This might be useful https://stackoverflow./a/63474748/10143503

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745146675a4613678.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信