내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

Resizing image question

Avatar

Level 3

Hi,

  I just get a small CQ5 project of resizing the smartImage. Right now, I have two options.

 One

 

Node jcrContent = currentNode.getNode("image/jcr:content"); String imagePath = jcrContent.getPath(); Resource imageRes = resourceResolver.getResource(imagePath); Image img = new Image(imageRes); img.setItemName(Image.NN_FILE, "image"); img.setSrc(img.getPath()); img.setSelector("img");

Once it is done, i will just use <image src="<%= img.getSrc() %>" width="35%" heigh="35%" /> to display a easy resized picture.

Option Two, extend the AbstractImageServlet to do a real resizing work.(This I havn't done yet).

My question is do these two approaches achive the same image quanlity?

 

Thank you

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Level 10

IMO,  Using image size attributes can make image appear to be squashed,  lower quality etc based on the value set.  With AbstractImageServlet internal uses layer by making use if Java2D API there by the rendering quality be as high as possible.

원본 게시물의 솔루션 보기

1 답변 개

Avatar

정확한 답변 작성자:
Level 10

IMO,  Using image size attributes can make image appear to be squashed,  lower quality etc based on the value set.  With AbstractImageServlet internal uses layer by making use if Java2D API there by the rendering quality be as high as possible.