I use Wijiwok, and how to process images

Asked 2 years ago, Updated 2 years ago, 49 views

Implementing web as node.js + express.

I know it's Wijiwok, so I'm implementing it as a summer note.

However, the content of the text in Wijiwok

<p>Hi</p><img src=\"data:image/png;base64,iVBORw0KGgoAAANSUHEUgAAEGAAAAAGAAADZOTHAAF1MLQZLQZLQZLQZLZLQZLZLZLZLZLZLQ

It was turned over like this, so after saving it as it is, I selected it in html format and loaded it, so I can even retrieve the image as it is. I don't know if that long code is the image's own data...

Usually, when you upload image processing, you save it to the server, save the image path to the database, and then, Do you use the method of loading to the saved image path when loading?

How about saving the entire image as above in the DB and writing it?

Please give me some advice on image processing regarding the development of bulletin boards.

node.js image wyswyg

2022-09-21 23:20

1 Answers

The above method is to encode binary (image) data with base64 into ASCII and handle it in text form.

So the image itself is correct.

The above processing makes it easy to process attached images without creating separate storage, but the image data can be stored in DB columns that store text, which can increase unnecessarily and cause limitations in column type setting.

In the case of older browsers, there is an image size limit, and it becomes unnecessary data when analyzing text data separately.

The number 1 method you wrote is a general implementation. In this case, if the image path is the local path of the web server, various problems arise during service expansion, such as which server has the image if you expand the web server to N.

When the service is small, shared storage such as nas is often used to share data between servers, and if the service grows and there are more images or attachments, a separate storage server is built


2022-09-21 23:20

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.