Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Resizing image question

Avatar

Avatar
Validate 10
Level 2
Rui_J
Level 2

Likes

4 likes

Total Posts

39 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 2
Rui_J
Level 2

Likes

4 likes

Total Posts

39 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
Rui_J
Level 2

15-10-2015

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

View Entire Topic

Avatar

Avatar
Boost 50
Level 10
Sham_HC
Level 10

Likes

161 likes

Total Posts

2,114 posts

Correct Reply

1,204 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 100
View profile

Avatar
Boost 50
Level 10
Sham_HC
Level 10

Likes

161 likes

Total Posts

2,114 posts

Correct Reply

1,204 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 100
View profile
Sham_HC
Level 10

15-10-2015

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.