}
}
- try {
- Instance.getTempFiles().close();
- } catch (IOException e) {
- Instance.getTraceHandler()
- .error(new IOException(
- "Cannot dispose of the temporary files", e));
+ // We cannot do it when in GUI mode, because it is async...
+ // So if we close the temp files before it is actually used,
+ // we have a problem...
+ // TODO: close it at the correct time (for now, finalize try to do it)
+ if (false) {
+ try {
+ Instance.getTempFiles().close();
+ } catch (IOException e) {
+ Instance.getTraceHandler().error(
+ new IOException(
+ "Cannot dispose of the temporary files", e));
+ }
}
if (exitCode == 255) {
if (resizedImage == null) {
try {
Image cover = null;
- if (meta.getLuid() == null) {
+ if (meta.getLuid() != null) {
+ cover = reader.getLibrary().getCover(meta.getLuid());
+ }
+ if (cover == null) {
cover = reader.getLibrary()
.getSourceCover(meta.getSource());
- } else {
- cover = reader.getLibrary().getCover(meta.getLuid());
}
BufferedImage coverb = ImageUtilsAwt.fromImage(cover);
import be.nikiroo.fanfix.bundles.Config;
import be.nikiroo.fanfix.data.MetaData;
import be.nikiroo.utils.Image;
+import be.nikiroo.utils.ImageUtils;
import be.nikiroo.utils.MarkableFileInputStream;
import be.nikiroo.utils.Progress;
}
}
- return BasicSupportImages.getImage(this, sourceFile.getParentFile(),
- path);
+ Image cover = BasicSupportImages.getImage(this,
+ sourceFile.getParentFile(), path);
+ if (cover != null) {
+ try {
+ File tmp = Instance.getTempFiles().createTempFile(
+ "test_cover_image");
+ ImageUtils.getInstance().saveAsImage(cover, tmp, "png");
+ tmp.delete();
+ } catch (IOException e) {
+ cover = null;
+ }
+ }
+
+ return cover;
}
@Override