Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
steelhead  
#1 Posted : Wednesday, April 12, 2017 9:35:30 AM(UTC)
steelhead

Rank: Member

Groups: Member
Joined: 10/23/2009(UTC)
Posts: 22

Thanks: 2 times
We currently resize original images on the server-side after upload, this allows us to convert all images to the same size - 720x540. If the the image original aspect ratio doesn't fit into 720x540 then we resize it to maximum possible image that can fit into 720x540, center it and fill the rest of the background with white color. This way all uploaded images are the same size and keep their proportions. We are planning switching to Amazon storage and thus want all the resizing to be done by uploader. It appears that none of the ThumbnailFitMode options would allow us to do the same thing as we do now - make all images the same size without cropping. I'm correct on that or I'm missing a setting? Thank you.
Alex Nikulin  
#2 Posted : Monday, April 17, 2017 4:02:21 AM(UTC)
Alex Nikulin

Rank: Newbie

Groups: Member
Joined: 4/12/2016(UTC)
Posts: 8

Was thanked: 2 time(s) in 2 post(s)
Hello Ross, Here is code, that makes fill color around a resized image. How to send to Amazon, you can see at our documentation and demo page.
Quote:
formatted-code.txt (4kb) downloaded 4 time(s).
Best regards Alex

Edited by user Monday, April 17, 2017 4:07:56 AM(UTC)  | Reason: Not specified

steelhead  
#3 Posted : Monday, April 17, 2017 7:27:50 AM(UTC)
steelhead

Rank: Member

Groups: Member
Joined: 10/23/2009(UTC)
Posts: 22

Thanks: 2 times
Hi Alex, I tried your code. The uploaded image is now constantly 720x540 in size, but unfortunately is not getting filled with white background when needed, instead it simply gets cropped. Here is an example of the console output: image size: 2896x1944 thumbnail size: 720x483 thumbnail size with fill color(#ffffff): 720x540 Crop bounds: [152, 0, 2592, 1944] The results are now identical to when thumbnailFitMode mode is set to Crop instead of Fit. Thank you.
Alex Nikulin  
#4 Posted : Monday, April 17, 2017 8:19:26 PM(UTC)
Alex Nikulin

Rank: Newbie

Groups: Member
Joined: 4/12/2016(UTC)
Posts: 8

Was thanked: 2 time(s) in 2 post(s)
Ross, Could you provide that image, please? I will test my code. This code is actually cropping an image, but with crop area with the size larger than the image, and then applies resize. I need to calculate better the crop bounds. Kind regards Alex

Edited by user Monday, April 17, 2017 8:25:45 PM(UTC)  | Reason: Not specified

Alex Nikulin  
#5 Posted : Tuesday, April 18, 2017 1:15:19 AM(UTC)
Alex Nikulin

Rank: Newbie

Groups: Member
Joined: 4/12/2016(UTC)
Posts: 8

Was thanked: 2 time(s) in 2 post(s)
Ross, I have done little changes in a code. Please check it. I think it is not necessary to send me an image. I have created the image with the same dimensions in Photoshop. formatted-code2.txt (4kb) downloaded 2 time(s).

Edited by user Wednesday, April 19, 2017 12:27:08 AM(UTC)  | Reason: Not specified

steelhead  
#6 Posted : Tuesday, April 18, 2017 6:47:19 PM(UTC)
steelhead

Rank: Member

Groups: Member
Joined: 10/23/2009(UTC)
Posts: 22

Thanks: 2 times
Hi Alex, You are the man! Your last fix worked, thank you! Last issue, not sure it can be resolved, after white borders are added at the bottom, the watermark is placed at the bottom of the original image, not the image with the borders. Is there a way to always put watermark at the bottom of the final image no matter if it has a border or not? Example attached !sample.jpg. { mode: '*=Thumbnail', thumbnailFitMode: 'Fit', thumbnailWidth: '720', thumbnailHeight: '540', thumbnailBgColor: 0xffffff, thumbnailResizeQuality: 'high', thumbnailWatermark: 'ImageUrl=/images/watermark.png;Width=200;Height=204;Opacity=60;Position=BottomRight;OffsetY=5;OffsetX=10;' }
Alex Nikulin  
#7 Posted : Wednesday, April 19, 2017 12:14:05 AM(UTC)
Alex Nikulin

Rank: Newbie

Groups: Member
Joined: 4/12/2016(UTC)
Posts: 8

Was thanked: 2 time(s) in 2 post(s)
Hello Ross, You can specify property When=AfterResize, and a watermark will be at the proper position. Documentation link:https://www.aurigma.com/docs/us8/applying-watermarks-iuf.htm#generalSettings
Quote:
{ mode: '*=Thumbnail', thumbnailFitMode: 'Fit', thumbnailWidth: '720', thumbnailHeight: '540', thumbnailBgColor: 0xffffff, thumbnailResizeQuality: 'high', thumbnailWatermark: 'ImageUrl=/images/watermark.png;Width=200;Height=204;Opacity=60;Position=BottomRight;OffsetY=5;OffsetX=10;When=AfterResize;' }
If you have any problems with the uploader, make a support ticket, please. Kind regards Alex

Edited by user Wednesday, April 19, 2017 12:21:24 AM(UTC)  | Reason: Not specified

thanks 1 user thanked Alex Nikulin for this useful post.
steelhead on 4/19/2017(UTC)
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.