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

Image on fullscreen never changes (Android) #13

Closed
willyguevara opened this issue Mar 20, 2015 · 7 comments
Closed

Image on fullscreen never changes (Android) #13

willyguevara opened this issue Mar 20, 2015 · 7 comments

Comments

@willyguevara
Copy link

Hi @slaptot i have a issue on android 4.2.2, when i try to open a new image in the fullscreen viewer, it is always showing the first image i have ever opened for the first time of the life of my app.
Does you need more details about the problems for helping me?

King regards!
PD: on iOS everything works really fine!

@willyguevara
Copy link
Author

Hello @slaptot any news?

@willyguevara
Copy link
Author

@slaptot i have been watching the code and i think i know why is this issue happening, is because the downloaded isn't deleted before opening another file or after going out the preview image . i will try doing a work around of this issue and send you any updates if i can fix it.

@willyguevara
Copy link
Author

Hello @slaptot here is a fix i do:
Since the problem is just on android you have to update the FullScreenImage.java file

add this code just after line 108:

if(f.exists() && !f.isDirectory()) {
boolean bReturn = f.delete();
}

and add this just after line 158:
if(filePath.exists() && !filePath.isDirectory()) {
boolean bReturn = filePath.delete();
}

this is actually working for me, i have tested only on android 4.2.2

@willyguevara willyguevara changed the title Image on fullscreen never changes Image on fullscreen never changes (Android) Mar 21, 2015
@slaptot
Copy link
Contributor

slaptot commented Mar 23, 2015

Hi @wilguevara ,
please make a pull request for it. Every enhancement we could do it´s good for all. Any way, we provide a string name in order to avoid this problem, so the app handle this problem (duplicate files in filesystem). Good job and Thanks!

@L-VE
Copy link

L-VE commented Apr 26, 2015

I had the same problem opening a base64 image string. The file that was opening in fullscreen, was written in storage under the name of output.jpg. Then I took a look at the java code and noticed that all the data of the file I was trying to open was just appended to the already existing "output.jpg" file. That's because of this line of code:

FileOutputStream os = new FileOutputStream(filePath, true); (on line 155)

You can change true to false to overwrite the "output.jpg" file.
This worked for me.

@willyguevara
Copy link
Author

@L-VE +1 thanks! i'll try this.

slaptot added a commit that referenced this issue May 8, 2015
#13

Fix solution https://github.com/L-VE:
I had the same problem opening a base64 image string. The file that was opening in fullscreen, was written in storage under the name of output.jpg. Then I took a look at the java code and noticed that all the data of the file I was trying to open was just appended to the already existing "output.jpg" file. That's because of this line of code:

#13;
@slaptot
Copy link
Contributor

slaptot commented May 8, 2015

@L-VE +1 thanks! Merged

@slaptot slaptot closed this as completed May 8, 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

No branches or pull requests

3 participants