Update to latest version of nikiroo-utils
authorNiki Roo <niki@nikiroo.be>
Thu, 6 Jul 2017 20:23:06 +0000 (22:23 +0200)
committerNiki Roo <niki@nikiroo.be>
Thu, 6 Jul 2017 20:23:06 +0000 (22:23 +0200)
changelog.md
libs/nikiroo-utils-1.6.1-sources.jar [deleted file]
libs/nikiroo-utils-2.0.0-sources.jar [new file with mode: 0644]
src/be/nikiroo/fanfix/Cache.java
src/be/nikiroo/fanfix/reader/GuiReaderBook.java
src/be/nikiroo/fanfix/supported/BasicSupport.java
src/be/nikiroo/fanfix/supported/Epub.java
src/be/nikiroo/fanfix/supported/MangaFox.java

index a27f9c8f27286e5c03fa16eda04c0dc65c77baec..cfcfb8292ce2c16c812f5d5ba74898faf4a555c1 100644 (file)
@@ -1,21 +1,27 @@
 # Fanfix
 
 ## Version WIP
+
 - New reader type: TUI (a text user interface with windows and menus)
 - A server option to offer stories on the network
 - A remote library to get said stories from the network
+- Update to latest version of nikiroo-utils
 
 ## Version 1.5.3
+
 - FimFiction: Fix tags and chapter handling for some stories
 
 ## Version 1.5.2
+
 - Fix tags metadata on FimFiction 4
 
 ## Version 1.5.1
+
 - Update to FimFiction 4
 - Fix some meta data that were missing on e-Hentai
 
 ## Version 1.5.0
+
 - New website supported following a request: e-hentai.org
 - Library: perf improvement when retrieving the stories (cover not loaded when not needed)
 - Library: fix the covers that were not always removed when deleting a story
diff --git a/libs/nikiroo-utils-1.6.1-sources.jar b/libs/nikiroo-utils-1.6.1-sources.jar
deleted file mode 100644 (file)
index 66f6734..0000000
Binary files a/libs/nikiroo-utils-1.6.1-sources.jar and /dev/null differ
diff --git a/libs/nikiroo-utils-2.0.0-sources.jar b/libs/nikiroo-utils-2.0.0-sources.jar
new file mode 100644 (file)
index 0000000..26cad68
Binary files /dev/null and b/libs/nikiroo-utils-2.0.0-sources.jar differ
index 632c8441a35d596dfa6a2f2fc4c635542d1dd83e..f7e1a81ad0699f70d46b6f03edd53574b3319d37 100644 (file)
@@ -26,6 +26,7 @@ import javax.imageio.ImageIO;
 import be.nikiroo.fanfix.bundles.Config;
 import be.nikiroo.fanfix.supported.BasicSupport;
 import be.nikiroo.utils.IOUtils;
+import be.nikiroo.utils.ImageUtils;
 import be.nikiroo.utils.MarkableFileInputStream;
 
 /**
@@ -319,7 +320,7 @@ public class Cache {
 
                if (!cached.exists() || isOld(cached, true)) {
                        InputStream imageIn = open(url, null, true);
-                       ImageIO.write(IOUtils.toImage(imageIn), Instance.getConfig()
+                       ImageIO.write(ImageUtils.fromStream(imageIn), Instance.getConfig()
                                        .getString(Config.IMAGE_FORMAT_CONTENT).toLowerCase(),
                                        cached);
                }
index 2a4266de25bab41c676364cb520b05b614850cf4..1334518a49feba8367df5f829ae2e48576a2458a 100644 (file)
@@ -27,7 +27,7 @@ import javax.swing.JPanel;
 import be.nikiroo.fanfix.Instance;
 import be.nikiroo.fanfix.data.MetaData;
 import be.nikiroo.fanfix.data.Story;
-import be.nikiroo.utils.IOUtils;
+import be.nikiroo.utils.ImageUtils;
 import be.nikiroo.utils.ui.UIUtils;
 
 /**
@@ -370,7 +370,7 @@ class GuiReaderBook extends JPanel {
                InputStream in = Instance.getCache().getFromCache(id);
                if (in != null) {
                        try {
-                               resizedImage = IOUtils.toImage(in);
+                               resizedImage = ImageUtils.fromStream(in);
                                in.close();
                                in = null;
                        } catch (IOException e) {
index fbdb47a9efe14795d53d6834be8c067239d29c9e..fc6bbd20bf015e274c10ccc9463dea5a2e9397f6 100644 (file)
@@ -25,7 +25,7 @@ import be.nikiroo.fanfix.data.MetaData;
 import be.nikiroo.fanfix.data.Paragraph;
 import be.nikiroo.fanfix.data.Paragraph.ParagraphType;
 import be.nikiroo.fanfix.data.Story;
-import be.nikiroo.utils.IOUtils;
+import be.nikiroo.utils.ImageUtils;
 import be.nikiroo.utils.Progress;
 import be.nikiroo.utils.StringUtils;
 
@@ -863,7 +863,7 @@ public abstract class BasicSupport {
                        InputStream in = null;
                        try {
                                in = Instance.getCache().open(url, getSupport(url), true);
-                               return IOUtils.toImage(in);
+                               return ImageUtils.fromStream(in);
                        } catch (IOException e) {
                        } finally {
                                if (in != null) {
index 6cfe4f3d38de3b26b6b4392e1d55fedfb82a32c2..0bd09bdc4f24e7560fda61e40ef4e82c0e5c227c 100644 (file)
@@ -15,6 +15,7 @@ import java.util.zip.ZipInputStream;
 import be.nikiroo.fanfix.Instance;
 import be.nikiroo.fanfix.data.MetaData;
 import be.nikiroo.utils.IOUtils;
+import be.nikiroo.utils.ImageUtils;
 import be.nikiroo.utils.MarkableFileInputStream;
 import be.nikiroo.utils.Progress;
 
@@ -114,7 +115,7 @@ class Epub extends InfoText {
                                        // Cover
                                        if (getCover()) {
                                                try {
-                                                       cover = IOUtils.toImage(zipIn);
+                                                       cover = ImageUtils.fromStream(zipIn);
                                                } catch (Exception e) {
                                                        Instance.syserr(e);
                                                }
index a379e877ecb5c5d296b85708b0b48ac89e856716..c8eaa1d3035d0fabee3af3ccd2a797ec080a7cce 100644 (file)
@@ -13,7 +13,7 @@ import java.util.Scanner;
 
 import be.nikiroo.fanfix.Instance;
 import be.nikiroo.fanfix.data.MetaData;
-import be.nikiroo.utils.IOUtils;
+import be.nikiroo.utils.ImageUtils;
 import be.nikiroo.utils.Progress;
 import be.nikiroo.utils.StringUtils;
 
@@ -186,7 +186,7 @@ class MangaFox extends BasicSupport {
                        try {
                                coverIn = openEx(cover);
                                try {
-                                       return IOUtils.toImage(coverIn);
+                                       return ImageUtils.fromStream(coverIn);
                                } finally {
                                        coverIn.close();
                                }