[Image Utils Mobile] resize doesn't work in IOS

[Image Utils Mobile] resize doesn't work in IOS

  
Forge Component
(3)
Published on 20 Apr by Harlin Setiadarma
3 votes
Published on 20 Apr by Harlin Setiadarma

Hi,

I building a mobile application that capture picture using the camera, but I need to reduce the image size before sending to server. 

The resize doesn't work, when I try to debug using a break point in resize action, the debugger execution point vanish!


Tried to apply the  MegaPixImage script but still doesn't work.


there is a way to debug the java script ?


Hi João Cardoso, 

Did you test it under IOS?

I used it on every mobile app I built and tested it ok under Android. (I don't have any IOS devices) 

If you test it under IOS, try to set gradualResize property to False.


Open Image Utils Mobile espace, then Resize action.
Then click on JS_Resize, then change gradualResize parameter to False.

Let me know if it helps...

I will fix it by disable gradualResize (when under IOS) if it does works...


Hi, please update my component.

I have exposed the gradualResize input parameter, and make it automatically false if using in IOS device.

Here's the change log:


https://www.outsystems.com/forge/Component_Versions.aspx?ProjectId=2078

Hi,


still doesn't work, when I call resize, the client action exit without any error message.


Thanks,


Hi sorry I'm really at lost. 

I don't have ios device so I can't really test it.

But on Android device it works perfectly.

I guess it's because of different javascript engine between Android/Chrome and IOS/Safari.

Hi, just to say that I use the Resize action from the component and it worked for IOS. I only sent he MaxWidthOrHeight value, the image and is done


Cheers

Nuno Oliveira wrote:

Hi, just to say that I use the Resize action from the component and it worked for IOS. I only sent he MaxWidthOrHeight value, the image and is done


Cheers

Nice to hear that it's working. 

Can you share your IOS device and version?

Thanks. 

Hi Harlin, sure, IOS 11.2.1, iPhone 7 

Cheers

Hi guys, 

we tried to use this component in iOS, and it didn't work. So we made some investigation and we found one bug on the component (that didn't fix the issue, but it's still a bug), and the solution to make it run on iOS.


The bug

Harlin Setiadarma stated:

"I have exposed the gradualResize input parameter, and make it automatically false if using in IOS device."

And you can see that in the code:


But in the Javascript node JS_Resize, it's always passed True to the gradualResize input parameter. So the gradualResize variable value it's being ignored:

The highlighted attribute in the image, needs to be set to gradualResize.


The solution to make the component work in iOS

On the JS node JS_Resize, just remove (or comment) the instruction to set the crossOrigin attribute to anonymous:

That did the trick for us. 


Regards,

João Carvalho

Wow, thank you João. 

I will fix it immediately. 

But the crossOrigin thing was needed in Android, I need to check it.

So maybe I'll make some condition based on device OS.


Thanks a lot... 

Harlin Setiadarma wrote:

Wow, thank you João. 

I will fix it immediately. 

But the crossOrigin thing was needed in Android.

So maybe I'll make some condition based on device OS.


Thanks a lot... 

Hi Harlin, 

You're welcome. 

We've also tested the component without the anonymous instruction in android, and it worked. Even though, I don't see any arm in using that instruction if the device is android based. 


Regards,

João Carvalho




Hi João,

Please also help me test whether gradualResize works or not on IOS.

Many thanks.