setMask in HTML?

sorry, I could not reproduce the issue.

@miguel.campiao

This is server hosted and not in private mode I don’t think… Less worried about this err anyway, it’s clearly a Firefox thing as opposed to something we can fix since it doesn’t happen in other browsers, but I just thought it might be a clue somehow as to why the masking isn’t working.

@vitaly1

Sorry, I totally intended to get an actual test script over to you over the weekend but somehow my weekend disappeared about 6 days earlier than I’d have liked! I’m determined to crack this one though and will definitely get a proper test over to you asap.

Right - example attached!

In the simulator this produces a properly masked image.But after compiling to HTML5 the mask isn’t applied and the error “Unsupported image format” is output:

https://development.qweb.co.uk/html5/test/index-debug.html

Sorry - previous attachment had an error - fixed and re-attached. This is the version that matches the above HTML link.

@richard11 as I see you are using build 3326 in https://development.qweb.co.uk/html5/test/index-debug.html

Try please last daily build, it’s 3355. Hoping it will resolve “… Unsupported image format” issue

Aha! Build 3355 does indeed work! Fantastic, thanks.

Hate to raise this one again, but is it at all possible that fixing masks in the HTML build has broken something in the Android build?

I’m seeing really odd masking glitches in Android builds now and can’t seem to pinpoint anything in code. I thought some of my math must be out, but even setting the x and y of masks to 0 is rendering them differently to the simulator!

Just installed Corona 2018.3362 to no avail.

Yep, something’s gone wrong. I’ve just downloaded the test that I provided earlier in this thread ( https://forums.coronalabs.com/index.php?app=core&module=attach&section=attach&attach_id=7803 ) and compiled for Android in the latest version, 2018.3362, and the result it totally skewed. Screenshots attached:

Simulator:

Android:

>>but is it at all possible that fixing masks in the HTML build has broken something in the Android build?

No, it should not.

I think our posts overlapped there - just in case you didn’t already notice, please ref my follow up post above - something has definitely broken =(. That screenshot is from the exact sample code I provided previously for the HTML issue. Still working in the simulator and thanks to your earlier fix, now in HTML, but in Android it’s quite massively skewed.

We will investigate the issue.

Next daily build should fix the issue.

Brilliant, thanks!

Just to confirm - just grabbed 2018.3363 and the Android build does now appear to be masking properly again. Thanks!

Thanks for the detailed bug report. We will fix it soon.

Are you 100% sure your saved mask files meet the requirements for masks?  This is very hard to do correctly and is often torpedoed by some scaling side-effect you didn’t notice.

Since you can’t inspect the files directly, it is hard to be sure.

The easiest way to check your masks is to actually draw one with newImage() and then see what the dimensions are.  

As far as I’m aware, yes. I recall spending hours (and hours… and hours… and probably hours) getting them to save out the right size, with the bordering, etc while content scaling tried to get in the way. But as you say, it’s a tad difficult to be sure without being able to see the resulting files.

I’ll experiment over the weekend with actually outputting the result to see if I can find any clues. The difficulty originally though was getting the files to save out at the same dimension as the render so if this is a re-occurrence of that, I’m only going to be able to tell if I can find the files.

…I’m curious. Does this mean you’ve found an issue to resolve? =)

If I load the resulting image in to display.newImage after saving it out, the result looks good. It’s black and white so the filtering is working and it looks to be the expected size. This also confirms the actual save is working, despite my still not being able to find the physical files.

This actually might be a bug with setMask then?

How soon after saving it are you trying to use it?

You may need to wait a few frames.