154
Views
12
Comments
[Image Utils Mobile] resize doesn't work in IOS
Question
image-utils-mobile
Mobile icon
Forge asset 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 ?


2024-03-25 06-19-08
Harlin Setiadarma

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...


2024-03-25 06-19-08
Harlin Setiadarma

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

UserImage.jpg
João Cardoso

Hi,


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


Thanks,


2024-03-25 06-19-08
Harlin Setiadarma

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.

2024-03-25 06-19-08
Harlin Setiadarma
2024-04-01 15-46-33
Nuno Oliveira

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

2024-03-25 06-19-08
Harlin Setiadarma

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. 

2024-04-01 15-46-33
Nuno Oliveira

Hi Harlin, sure, IOS 11.2.1, iPhone 7 

Cheers

UserImage.jpg
João Carvalho

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

2024-03-25 06-19-08
Harlin Setiadarma

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... 

UserImage.jpg
João Carvalho

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




2024-03-25 06-19-08
Harlin Setiadarma

Hi João,

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

Many thanks. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.