[Image Utils Mobile] Gradual resize only returns part of the image

[Image Utils Mobile] Gradual resize only returns part of the image

  
Forge Component
(2)
Published on 15 May by Harlin Setiadarma
2 votes
Published on 15 May by Harlin Setiadarma

Hi,

I've tried "Resize" action to resize 225x225 to 25x25px image but the result is only top left quarter of the image with correct 25x25 size. "straight resize" however is working fine.

Regards,

Nick

What do you mean by straight resize? 

Are you sure you're using Resize action, not crop action?

Can you attach OML? 

Hi Harlin,

If image is less then 2 times bigger then desired size the JS_Resize node uses straight resize  as itv called on comments

if ($parameters.gradualResize && width < imgR.width/2) {    ... } else {     // straight resize  ... }

I've find out that it only happens on Safari (desktop and mobile) . On Chrome it is ok

I don't have safari, so I haven't test it. 

Maybe js canvas implementation of Safari is abit different than Chrome.

Thanks for reporting this, I will have to research more about this.

Here are screenshots from safari and chrome:

Safari 


Chorme

Since I don't have a Mac, I tried installing Safari for Windows 5.1.7 which has been abandoned by Apple.

Alas, even the basic UI is rendered incorrectly by Safari for Windows, I cannot even click Upload button.

Unless someone donating me a mac, I cannot fix this lol...

BTW, can you test this in a real iphone using Outsystems Now?


Hi Harlin,

Yes, I've tested on the real iPhone and it works with same error. I suppose it is related to the resize loop. I will try to solve this issue on Monday.

Any progress fixing the JS on Safari/iOS?

Please get back to me if you have successfully fixing it, so I can incorporate it to my component.

Thanks.

Hi, 

Iused a workaround to have smaller images thumbnails doing resting severside with image toolbox component. So no actual fix. As a temporary preventing this you can set check for browser and only allow gradual resize on chrome. 


Hi Mykola, I managed to borrow an ipad, and doing safari browser test using this URL:

https://harlin.outsystemscloud.com/PreviewInDevices/?IsMobilePreview=True&DeviceName=Smartphone&URL=/ImageUtilsMobile_Sample/Upload


And as you can clearly see below, my gradual resize works fine in iPad's Safari...

I will also try to borrow a friend's iphone later...

Maybe this problem only occurs on MacBook's Safari browser?