Skip to content

Commit

Permalink
refactor: 썸네일용 이미지를 png로 변환하지 않고 svg로 저장한다. (#764)
Browse files Browse the repository at this point in the history
  • Loading branch information
tributetothemoon authored Jan 24, 2022
1 parent a00763b commit 2612899
Show file tree
Hide file tree
Showing 93 changed files with 75 additions and 2,150 deletions.
8 changes: 0 additions & 8 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,3 @@
path = backend/src/main/resources/config
url = [email protected]:zzimkkong/config.git
branch = main
[submodule "s3proxy/src/main/resources/s3proxy-config"]
path = s3proxy/src/main/resources/s3proxy-config
url = [email protected]:zzimkkong/s3proxy-config.git
branch = main
[submodule "s3proxy/src/main/resources/config"]
path = s3proxy/src/main/resources/config
url = [email protected]:zzimkkong/config.git
branch = main
6 changes: 0 additions & 6 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ dependencies {
// Jwt
implementation 'io.jsonwebtoken:jjwt:0.9.1'

// SvgToPng
implementation 'org.apache.xmlgraphics:batik-all:1.12'
implementation 'org.apache.xmlgraphics:xmlgraphics-commons:2.4'
implementation 'xml-apis:xml-apis:1.4.01'
implementation 'xml-apis:xml-apis-ext:1.3.04'

// Cryptor
implementation 'commons-codec:commons-codec:1.15'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void run(String... args) {
new Map(
"루터회관",
"{'id': '1', 'type': 'polyline', 'fill': '', 'stroke': 'rgba(111, 111, 111, 1)', 'points': '['60,250', '1,231', '242,252']', 'd': '[]', 'transform': ''}",
"https://d1dgzmdd5f1fx6.cloudfront.net/thumbnails-local/1.png",
"<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"950\" height=\"610\"><polyline points=\"40,560 300,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"300,440 130,440\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"110,440 130,440\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"110,460 110,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"110,350 110,440\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"110,330 300,330\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"300,270 300,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"220,270 220,330\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"140,270 140,330\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"240,270 300,270\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"160,270 220,270\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"110,280 110,310\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"110,310 120,310\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"120,310 120,280\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"120,280 110,280\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"110,500 40,500\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"50,560 50,200\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"40,200 100,200\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"120,200 120,130\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"120,130 40,130\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"90,200 90,240\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"90,240 50,240\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"140,200 300,200\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"120,60 120,140\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"300,330 400,330\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"500,330 600,330\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"450,350 430,370\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"430,370 440,370\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"440,370 440,410\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"440,410 460,410\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"460,410 460,370\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"460,370 470,370\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"470,370 450,350\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"450,260 460,260\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"460,260 460,70\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"460,70 450,70\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"450,70 450,260\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"500,260 600,260\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"500,190 520,170\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"520,170 520,120\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"520,120 540,100\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"540,100 560,100\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"560,100 580,120\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"580,120 580,260\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"600,260 630,260\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"600,220 630,220\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"600,180 630,180\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"600,140 630,140\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"600,100 630,100\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"630,140 630,160\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"630,180 630,200\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"630,220 630,240\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"600,330 600,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"630,260 630,290\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"630,290 500,290\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"500,290 500,260\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"300,270 330,270\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"330,270 330,330\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"680,230 680,290\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"680,230 680,180\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"300,60 300,200\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"40,60 910,60\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"910,60 910,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"910,560 600,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"680,230 910,230\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"820,230 820,290\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"730,230 730,290\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"680,290 800,290\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"840,290 910,290\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"680,60 680,100\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"40,60 40,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"500,190 500,60\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"370,330 370,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"300,560 370,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"530,330 530,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"530,560 600,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"600,60 600,260\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"630,80 630,120\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><g data-testid=\"42\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"110\" y=\"440\" width=\"190\" height=\"120\" fill=\"#0060FF\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"205\" y=\"500\" class=\"sc-carFqZ hTwlVf\">프론트 강의실1</text></g><g data-testid=\"43\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"110\" y=\"330\" width=\"190\" height=\"110\" fill=\"#0060FF\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"205\" y=\"385\" class=\"sc-carFqZ hTwlVf\">프론트 강의실 2</text></g><g data-testid=\"46\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"220\" y=\"270\" width=\"80\" height=\"60\" fill=\"#EB3933\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"260\" y=\"300\" class=\"sc-carFqZ hTwlVf\">회의실 3</text></g><g data-testid=\"47\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"140\" y=\"270\" width=\"80\" height=\"60\" fill=\"#EB3933\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"180\" y=\"300\" class=\"sc-carFqZ hTwlVf\">회의실 4</text></g><g data-testid=\"48\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"40\" y=\"130\" width=\"80\" height=\"70\" fill=\"#EB3933\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"80\" y=\"165\" class=\"sc-carFqZ hTwlVf\">회의실 5</text></g><g data-testid=\"50\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"600\" y=\"220\" width=\"30\" height=\"40\" fill=\"#8B5CF6\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"615\" y=\"240\" class=\"sc-carFqZ hTwlVf\">1</text></g><g data-testid=\"51\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"600\" y=\"180\" width=\"30\" height=\"40\" fill=\"#8B5CF6\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"615\" y=\"200\" class=\"sc-carFqZ hTwlVf\">2</text></g><g data-testid=\"52\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"600\" y=\"140\" width=\"30\" height=\"40\" fill=\"#8B5CF6\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"615\" y=\"160\" class=\"sc-carFqZ hTwlVf\">3</text></g><g data-testid=\"53\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"600\" y=\"100\" width=\"30\" height=\"40\" fill=\"#8B5CF6\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"615\" y=\"120\" class=\"sc-carFqZ hTwlVf\">4</text></g><g data-testid=\"55\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"40\" y=\"500\" width=\"70\" height=\"60\" fill=\"#FFEE58\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"75\" y=\"530\" class=\"sc-carFqZ hTwlVf\">방송실</text></g><g data-testid=\"56\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"50\" y=\"200\" width=\"40\" height=\"40\" fill=\"#FFEE58\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"70\" y=\"220\" class=\"sc-carFqZ hTwlVf\">전화</text></g><g data-testid=\"67\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"600\" y=\"330\" width=\"310\" height=\"230\" fill=\"#6BC2F9\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"755\" y=\"445\" class=\"sc-carFqZ hTwlVf\">백엔드 강의실</text></g><g data-testid=\"68\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"820\" y=\"230\" width=\"90\" height=\"60\" fill=\"#EB3933\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"865\" y=\"260\" class=\"sc-carFqZ hTwlVf\">회의실 1</text></g><g data-testid=\"69\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"730\" y=\"230\" width=\"90\" height=\"60\" fill=\"#EB3933\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"775\" y=\"260\" class=\"sc-carFqZ hTwlVf\">회의실 2</text></g><g data-testid=\"70\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"600\" y=\"60\" width=\"30\" height=\"40\" fill=\"#8B5CF6\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"615\" y=\"80\" class=\"sc-carFqZ hTwlVf\">5</text></g><g data-testid=\"71\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"500\" y=\"60\" width=\"100\" height=\"200\" fill=\"#5CAC1E\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"550\" y=\"160\" class=\"sc-carFqZ hTwlVf\">트랙방</text></g></svg>",
pobi)
);

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

14 changes: 7 additions & 7 deletions backend/src/main/java/com/woowacourse/zzimkkong/domain/Map.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Map {

@Column(nullable = false)
@Lob
private String mapImageUrl;
private String thumbnail;

@ManyToOne
@JoinColumn(name = "member_id", foreignKey = @ForeignKey(name = "fk_map_member"), nullable = false)
Expand All @@ -35,19 +35,19 @@ public class Map {
@OneToMany(mappedBy = "map", cascade = CascadeType.REMOVE, fetch = FetchType.LAZY, orphanRemoval = true)
private List<Space> spaces = new ArrayList<>();

public Map(final String name, final String mapDrawing, final String mapImageUrl, final Member member) {
public Map(final String name, final String mapDrawing, final String thumbnail, final Member member) {
this.name = name;
this.mapDrawing = mapDrawing;
this.mapImageUrl = mapImageUrl;
this.thumbnail = thumbnail;
this.member = member;

if (member != null) {
member.addMap(this);
}
}

public Map(final Long id, final String name, final String mapDrawing, final String mapImageUrl, final Member member) {
this(name, mapDrawing, mapImageUrl, member);
public Map(final Long id, final String name, final String mapDrawing, final String thumbnail, final Member member) {
this(name, mapDrawing, thumbnail, member);
this.id = id;
}

Expand All @@ -71,8 +71,8 @@ public Optional<Space> findSpaceById(final Long spaceId) {
.findFirst();
}

public void updateImageUrl(final String mapImageUrl) {
this.mapImageUrl = mapImageUrl;
public void updateThumbnail(final String thumbnail) {
this.thumbnail = thumbnail;
}

public void addSpace(final Space space) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ public class MapCreateUpdateRequest {
private String mapDrawing;

@NotBlank(message = EMPTY_MESSAGE)
private String mapImageSvg;
private String thumbnail;

public MapCreateUpdateRequest(final String mapName, final String mapDrawing, final String mapImageSvg) {
public MapCreateUpdateRequest(final String mapName, final String mapDrawing, final String thumbnail) {
this.mapName = mapName;
this.mapDrawing = mapDrawing;
this.mapImageSvg = mapImageSvg;
this.thumbnail = thumbnail;
}
}
Loading

0 comments on commit 2612899

Please sign in to comment.