简体   繁体   English

上传时模糊图像

[英]Blur image on upload

I'm developing a web application using Angular and Firebase.我正在使用 Angular 和 Firebase 开发 web 应用程序。 On the application, users can upload an image, and then other users can purchase that image.在应用程序上,用户可以上传图片,然后其他用户可以购买该图片。 the problem is, I want to upload a blurred version of the image to Firebase storage so that I will have 2 versions of the image: the original image and the blurred image.问题是,我想将图像的模糊版本上传到 Firebase 存储,这样我就有两个版本的图像:原始图像和模糊图像。 once the user purchases the image he could download the original image.一旦用户购买了图像,他就可以下载原始图像。

I added a CSS property filter: blur(5px) brightness(0.5);我添加了一个 CSS 属性filter: blur(5px) brightness(0.5); but this is obviously bad practice since the users can either change the CSS property from the dev tools if they have some knowledge or just right click and save image as from the site and get the original one.但这显然是一种不好的做法,因为用户可以通过开发工具更改 CSS 属性,如果他们有一些知识,或者只需右键单击save image as来自站点并获取原始图像。

So my question is, what options do I have to blur the image?所以我的问题是,我必须使用哪些选项来模糊图像? in my opinion I should blur the image on upload so that I will have 2 versions of the image saved on storage so that a user can see the blurred version of the image before he purchase it.在我看来,我应该在上传时模糊图像,以便我将图像的 2 个版本保存在存储中,以便用户在购买之前可以看到图像的模糊版本。

This has nothing to do with angular or firebase .这与angularfirebase 无关 What you need is a image processing node library .你需要的是一个图像处理节点库

I would suggest to use -我建议使用 -

If you face any issue regarding their use, than share.如果您在使用它们时遇到任何问题,请分享。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM