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

Fix thumbnails not displaying #23

Merged
merged 1 commit into from
Dec 31, 2015
Merged

Fix thumbnails not displaying #23

merged 1 commit into from
Dec 31, 2015

Conversation

bradbyte
Copy link
Contributor

Fix issue #22 by adding .png to the tempfilePath. It can now be sourced directly in the <Image/> tag by the uri key.

@morenoh149
Copy link
Owner

couldn't you also append .png on the javascript side? does that not work?
pros and cons?

@bradbyte
Copy link
Contributor Author

I just tried that in the app by appending .png to the uri... still no luck. That shouldn't work because the files are being saved as thumbimage_XXXX so changing the path in JS would cause it to look for a file called thumbimage_XXXX.png, which wouldn't exist. I guess for some reason it can't read the file without an extension? I'm not super familiar with xcode, but is there a reason to not add an extension to the temp image files?

Thanks,

@morenoh149
Copy link
Owner

Nope. Just trying to understand the code by asking a question.

@bradbyte
Copy link
Contributor Author

No worries! :) it's really hard to find answers online related to this since the RN core API has changed.

I was able to troubleshoot this fix by downloading the App's data container from my device, and being able to see all of the thumbimage files in the tmp folder. Opening them on my mac revealed the picture was fine. Yet for some reason they wouldn't load in JS. I was just trying to see what I could do to make them recognize that they were indeed image files.. so I tried appending the .png prefix.

Most of the asset packaging docs out there now refer to requiring local files relative to the source code.... but these are temp files on the device itself. Maybe down the road someone will find a better, less hacky way to do this.

@rt2zz, thoughts?

Thanks!

@rt2zz
Copy link
Collaborator

rt2zz commented Dec 31, 2015

This sounds reasonable. I cannot find anywhere the indicates that kABPersonImageFormatThumbnail is actually a png, @bradbumbalough can you confirm that the files are in fact png's?

Either way I will take this into master but not cut a new release until things are better tested/understood

rt2zz added a commit that referenced this pull request Dec 31, 2015
Fix thumbnails not displaying
@rt2zz rt2zz merged commit 30696c2 into morenoh149:master Dec 31, 2015
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

Successfully merging this pull request may close these issues.

3 participants