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

Add permanent caching support to ImgIOUtils #7

Closed
ctrueden opened this Issue Jun 8, 2012 · 9 comments

Comments

Projects
None yet
3 participants
@ctrueden
Copy link
Member

ctrueden commented Jun 8, 2012

The ImgIOUtils class currently caches HTTP downloads of images in a temporary file which is deleted upon JVM exit. Better would be to cache permanently in the ~/.imglib2 folder. In this way, we can avoid having any large binary files committed to the git repository.

@dscho

This comment has been minimized.

Copy link
Member

dscho commented Jun 8, 2012

Is this something used for the tests (does not look like it from the path...)? If so, I'd recommend having a Maven artifact with the images. I don't really like a library to write into my home directory without an application asking it to explicitly...

@ctrueden

This comment has been minimized.

Copy link
Member Author

ctrueden commented Jun 8, 2012

The method in question is ImgIOUtils.cacheId(String):

$ git grep -l ImgIOUtils.cache
imglib2/tests/src/test/java/net/imglib2/view/CopyViews.java
imglib2/ui/src/main/java/net/imglib2/ui/ImgPanel.java

@dscho

This comment has been minimized.

Copy link
Member

dscho commented Jun 8, 2012

Oh, so it is used in tests, but also in the ImgPanel... Hmm. @axtimwalde @tpietzsch @StephanPreibisch any comments what ImgPanel does, caching images?

@ctrueden

This comment has been minimized.

Copy link
Member Author

ctrueden commented Jun 8, 2012

The ImgPanel is an early UI effort we coded at a previous hackathon. It hasn't been developed much since then, and mainly exists for demonstration purposes.

ImgIOUtils.cacheId is only used in ImgPanel.main, for testing.

@dscho

This comment has been minimized.

Copy link
Member

dscho commented Jun 8, 2012

Then I vote for moving this into src/test/java/ and keeping the temporary file approach...

@ctrueden ctrueden closed this Jun 26, 2012

@ctrueden

This comment has been minimized.

Copy link
Member Author

ctrueden commented Jun 26, 2012

ImgPanel has been moved to imglib2-tests in 7338fa1. ImgIOUtils will remain unchanged.

@StephanPreibisch

This comment has been minimized.

Copy link
Member

StephanPreibisch commented Jul 11, 2012

Hi Curtis,

sorry, I missed this mail. At the end it is great to have this option, adding .tmp files to the git-ignore might just do it, too. But I agree, in the long run it would be good to put it in the home folder, or just be able to choose where ...

But awesome this works now!

Bye bye,
Steffi

On Jun 8, 2012, at 13:21 , Curtis Rueden wrote:

The ImgIOUtils class currently caches HTTP downloads of images in a temporary file which is deleted upon JVM exit. Better would be to cache permanently in the ~/.imglib2 folder. In this way, we can avoid having any large binary files committed to the git repository.


Reply to this email directly or view it on GitHub:
#7

@ctrueden

This comment has been minimized.

Copy link
Member Author

ctrueden commented Jul 11, 2012

@StephanPreibisch: To be clear, based on discussion with @dscho, we decided not to pursue the improvements described above. That is, the downloaded files are always still deleted on exit. If you would like to eventually improve the ImgIOUtils to cache files more permanently in e.g. your home folder, then feel free to reopen this ticket.

@StephanPreibisch

This comment has been minimized.

Copy link
Member

StephanPreibisch commented Jul 11, 2012

That is completely fine with me .... great stuff!

On Jul 11, 2012, at 16:59 , Curtis Rueden wrote:

@StephanPreibisch: To be clear, based on discussion with @dscho, we decided not to pursue the improvements described above. That is, the downloaded files are always still deleted on exit. If you would like to eventually improve the ImgIOUtils to cache files more permanently in e.g. your home folder, then feel free to reopen this ticket.


Reply to this email directly or view it on GitHub:
#7 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.