-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Wrapping the Open source WYSIWYG. | ||
|
||
> | ||
> <img src="./images/base64.png"> | ||
> | ||
> *"에디터에 사진을 추가했더니 게시글 데이터가 미친듯이 올라갔어요 !"* | ||
#### 1. Situation | ||
[summernote](https://summernote.org/) 를 비롯한 대부분의 오픈소스 위지위그 에디터에 이미지를 첨부하면 **base64 인코딩** 되면서 첨부된다. | ||
|
||
#### 2. Problem | ||
저렇게 엄청난 문자열 데이터를 **데이터베이스에 저장하는 것 자체도 문제**인데, http 통신을 할 때 패킷이 감당할 수 없는 데이터를 보내기 때문에 **통신 자체가 안되는 경우**까지도 생긴다. | ||
|
||
#### 3. Solution | ||
해결법은 **AWS S3, MINIO 같은 스토리지 서버에 이미지를 저장**하고, 그 이미지를 API GET 하는 방법이다. | ||
|
||
#### 4. Process | ||
간단한 프로세스는 이렇다. | ||
|
||
1. 이미지 첨부 | ||
2. 스토리지 서버에 저장 | ||
3. **이미지 태그로 치환 (중요 포인트)** | ||
|
||
##### 4-1. support | ||
"이미지 태그로 치환" 이 부분은 에디터단에서 지원해주는게 중요하다. | ||
만약 위 프로세스대로 진행하려는데, 에디터에서 해당 기능을 지원해주지 않는다면.. <s>매우 고생할 것이다.</s> 🤦 | ||
|
||
그렇기 때문에 시중에 있는 오픈소스 위지위그 에디터를 채택할 때 **해당 기능을 지원 해주는지 반드시 고려**해봐야한다. | ||
|
||
##### 4-2. then.. | ||
|
||
> | ||
> <img src="./images/img_tag.png"> | ||
> | ||
> *"이미지 태그 " <img> " 하나로 불러오니깐 깔끔하네 !"* |