Access Images in a zip file without unzipping

20 Ansichten (letzte 30 Tage)
Tobias Kiessling
Tobias Kiessling am 27 Apr. 2011
Hi all,
I'd like to read some png-images within a zip file on my harddisk. Since I have thousands of images within hundreds of zip files, it would be extremely nice to read the image files without the need for unzipping the requested files to my harddrive). I've opened matlab's unzip.m file and realized, that it is partially written in java. I'm not very experienced with Java, but maybe some of you know a handy solution for my problem (a special java class, or a method for this 'org.apache.tools.zip.ZipFile' class unzip.m is using)
thanks, tobi

Antworten (1)

Jarrod Rivituso
Jarrod Rivituso am 27 Apr. 2011
You may be able to find an external unzip utility and call it from within MATLAB using the system function. The GNU unzip seems to support the behavior you are looking for:
If you aren't very experienced with Java, I wouldn't recommend going the Java route, though I'm sure this could be done using something like what is described here:
So, I'd recommend you
  1. Find and install a utility that gives you the required functionality, such as the GNU unzip. Make sure it is on your system path when you start MATLAB.
  2. Call the utility from within MATLAB using the system function
system('unzip allPics.zip pic314.png');
Hope this helps!
  1 Kommentar
Tobias Kiessling
Tobias Kiessling am 28 Apr. 2011
Ok, this is a solution, however, I still have to extract parts of the zip-file to the harddrive, and then again load it into memory for reading the image data into matlab. That's what I actually was trying to avoid. Nevertheless, thank you very much for your answer

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by