Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLKTextureLoader: EXC_BAD_ACCESS #55

Closed
bohachevskyy opened this issue Nov 1, 2016 · 14 comments
Closed

GLKTextureLoader: EXC_BAD_ACCESS #55

bohachevskyy opened this issue Nov 1, 2016 · 14 comments

Comments

@bohachevskyy
Copy link

Hello @robbykraft Thank you for this great project!
I have builded application for swift and all works well. App works when I load image from project:

panoramaView.setImageWithName("2048.jpg")

But, when I try to show image from photo library, I got error EXC_BAD_ACCESS. Error happens in method:

-(GLKTextureInfo *) loadTextureFromImage:(UIImage *) image

Line:

info = [GLKTextureLoader textureWithCGImage:image.CGImage options:options error:&error];

I'm picking image from photo library with UIImagePickerController. Image loads and shows fine.
Will be glad for any help!

@kopiro
Copy link

kopiro commented Nov 7, 2016

up!

@bohachevskyy
Copy link
Author

Hello @kopiro, do you have same problem as my?

@kopiro
Copy link

kopiro commented Nov 7, 2016

yes :(
Do you have any idea?

It works fine, but I'm trying to wrap in a Titanium module and it crashes.

@bohachevskyy
Copy link
Author

@kopiro Don't have any ideas. I will let you know when find solution. Good to know that I'm not alon

@bohachevskyy
Copy link
Author

Hello @kopiro I have fixed the problem. This error occurred due to unsupportable image size (image must have proportion 2x1). I have created crop tool for resizing any image. You can find tool here:

https://gist.github.com/Rommanski/142f0b56ef553222a8fc221e2d4deee6

@kopiro
Copy link

kopiro commented Nov 9, 2016

My image is 2x1 :(

@kopiro
Copy link

kopiro commented Nov 9, 2016

Should I crop it anyway?

@bohachevskyy
Copy link
Author

@robbykraft Maybe, there is reason to include same tool to the library? This solution will prevent problems with incorrect image size.

@bohachevskyy
Copy link
Author

@kopiro Of corse not. Unfortunately, I don't have experience with Titanium. Do you try to include this native module to your app?

@kopiro
Copy link

kopiro commented Nov 9, 2016

I'm working to wrap it in a Titanium module, but it doesn't works with this crash.
Trying to crop anyway, maybe it helps.

@mayakraft
Copy link
Owner

thanks for solving @Rommanski

yes, the instruction is in the readme, though after hearing from you, maybe it's not obvious enough.

i agree! including a scaling library would be helpful, though, i'm hung up on user design details -

  1. what happens when image is not 1:2? do we preserve aspect + crop, or scale axes independently?

I'm testing to see what I can do, a 1:2 but not a power of 2 (500x250) - I'm getting no errors generated, and "info" appears to load, (even though it doesn't show, as it shouldn't):

info = [GLKTextureLoader textureWithCGImage:image.CGImage options:options error:&error];

a work around would be load the image twice. First time as a UIImage, validate width and height properties, then if all checks out load the image again as a GLKTexture.. there must be a more elegant solution

@kopiro
Copy link

kopiro commented Nov 9, 2016

Is there any chances that you can help me? I didn't solved yet :(
Thanks in advance

On Wednesday, November 9, 2016, Robby Kraft notifications@github.com
wrote:

thanks for solving @Rommanski https://github.com/Rommanski

yes, the instruction is in the readme, though after hearing from you,
maybe it's not obvious enough.

i agree! including a scaling library would be helpful, though, i'm hung up
on user design details -

  1. what happens when image is not 1:2? do we preserve aspect + crop, or
    scale axes independently?

I'm testing to see what I can do, a 1:2 but not a power of 2 (500x250) -
I'm getting no errors generated, and "info" appears to load, (even though
it doesn't show, as it shouldn't):

info = [GLKTextureLoader textureWithCGImage:image.CGImage options:options
error:&error];

a work around would be load the image twice. First time as a UIImage,
validate width and height properties, then if all checks out load the image
again as a GLKTexture.. there must be a more elegant solution


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#55 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAzQFFQgigNZe0rQNzs4vYVcRbIhPH8zks5q8hP_gaJpZM4KmKU4
.

@mayakraft
Copy link
Owner

@kopiro are you using the included image? what are the dimensions of the image you are using?

@kopiro
Copy link

kopiro commented Nov 9, 2016

I have answered on the other issue, thank you :)

On Wednesday, November 9, 2016, Robby Kraft notifications@github.com
wrote:

@kopiro https://github.com/kopiro are you using the included image?
what are the dimensions of the image you are using?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#55 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAzQFHQDxlj6untDIYUJEP9P9Bc9uprwks5q8hbngaJpZM4KmKU4
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants