UnityImageCropper icon indicating copy to clipboard operation
UnityImageCropper copied to clipboard

Null texture returned when user does not change crop anchors

Open yosun opened this issue 2 years ago • 5 comments

Cropper should return the texture regardless of whether user has changed anchor positions etc.

I commented out lines in ImageCropper.cs below as a temp fix

Line 442

		/*if( !gameObject.activeInHierarchy )
		{
			Debug.LogError( "Cropper is not visible!" );
			return null;
		}*/

yosun avatar Jun 15 '23 07:06 yosun

It shouldn't be about anchor positions. If the ImageCropper GameObject is not active in the scene, then this issue will occur. I think you're trying to crop the image programmatically without showing the ImageCropper user interface, am I correct?

yasirkula avatar Jun 15 '23 08:06 yasirkula

Nope try running it where the user does not move any cropper point before pressing crop button - null image returned

yosun avatar Jun 15 '23 09:06 yosun

I can't reproduce this issue in the demo scene:

https://github.com/yasirkula/UnityImageCropper/assets/10211608/88a05df0-aed1-4825-bfb3-30460576a249

yasirkula avatar Jun 18 '23 08:06 yasirkula

Try it with unity game display set to a explicit screensize, say iphone 1170x2532

Message ID: @.***>

yosun avatar Jun 19 '23 13:06 yosun

My previous test was on 5.6.2f1 with Free Aspect ratio. Now I've tested again with 2020.3.26f1 URP 1125x2436 fixed resolution and it worked again :)

yasirkula avatar Jun 20 '23 11:06 yasirkula