diff options
author | Andrew Dolgov <[email protected]> | 2012-12-20 11:11:22 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2012-12-20 11:11:22 +0300 |
commit | 6661a5801e679f8f21ece7cbdd4f2dd3a4ae5eee (patch) | |
tree | 0c08b051d3da202c52039af0573ddb225e6c40cd /src | |
parent | 568f70786722144552b34d77f88a2b7f642accb4 (diff) |
support PNG files, duh
Diffstat (limited to 'src')
-rw-r--r-- | src/org/fox/ttcomics/CbrComicArchive.java | 2 | ||||
-rw-r--r-- | src/org/fox/ttcomics/CbzComicArchive.java | 2 | ||||
-rw-r--r-- | src/org/fox/ttcomics/ComicArchive.java | 3 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/org/fox/ttcomics/CbrComicArchive.java b/src/org/fox/ttcomics/CbrComicArchive.java index 2ca718f..b1fb65d 100644 --- a/src/org/fox/ttcomics/CbrComicArchive.java +++ b/src/org/fox/ttcomics/CbrComicArchive.java @@ -47,7 +47,7 @@ public class CbrComicArchive extends ComicArchive { if (!header.isDirectory()) {
String name = header.isUnicode() ? header.getFileNameW() : header.getFileNameString();
- if (name.toLowerCase().matches(".*\\.(jpg|bmp|gif)$")) {
+ if (isValidComic(name)) {
m_entries.add(header);
}
}
diff --git a/src/org/fox/ttcomics/CbzComicArchive.java b/src/org/fox/ttcomics/CbzComicArchive.java index ecbbd5f..ad2a64a 100644 --- a/src/org/fox/ttcomics/CbzComicArchive.java +++ b/src/org/fox/ttcomics/CbzComicArchive.java @@ -33,7 +33,7 @@ public class CbzComicArchive extends ComicArchive { while (e.hasMoreElements()) {
ZipEntry ze = e.nextElement();
- if (!ze.isDirectory() && ze.getName().toLowerCase().matches(".*\\.(jpg|bmp|gif)$")) {
+ if (!ze.isDirectory() && isValidComic(ze.getName())) {
m_entries.add(ze);
m_count++;
}
diff --git a/src/org/fox/ttcomics/ComicArchive.java b/src/org/fox/ttcomics/ComicArchive.java index 1dedda6..3070323 100644 --- a/src/org/fox/ttcomics/ComicArchive.java +++ b/src/org/fox/ttcomics/ComicArchive.java @@ -6,4 +6,7 @@ import java.io.InputStream; public abstract class ComicArchive {
public abstract int getCount();
public abstract InputStream getItem(int index) throws IOException;
+ public boolean isValidComic(String fileName) {
+ return fileName.toLowerCase().matches(".*\\.(jpg|bmp|gif|png)$");
+ }
}
|