Access Images in a zip file without unzipping

8 次查看(过去 30 天)
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

回答(1 个)

Jarrod Rivituso
Jarrod Rivituso 2011-4-27
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 个评论
Tobias Kiessling
Tobias Kiessling 2011-4-28
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

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by