riderkick / FMD

Forked from https://sf.net/p/fmd/
GNU General Public License v2.0
719 stars 213 forks source link

Sometimes chapters are packaged in PDF #47

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hi, i prefer to leave my manga in PDFs. Sometimes a chapter gets downloaded, it doesnt compress it into PDF but it says as a folder of pictures.

Is there a reason for this? Anyway I can fix it?

riderkick commented 9 years ago

Probably your download is incomplete.

ghost commented 9 years ago

Well it goes like this;

Chapter 1.pdf

Chapter 2 (folder)

Chapter 3.pdf

Why would it start the chapter 3 download before finishing Chapter 2?

Thanks for the response btw

riderkick commented 9 years ago

Probably there is an error while downloading chapter 2(some images can't be download), so it will continue to chapter 3. But it should show "Failed" if there is some failed chapter.

ghost commented 9 years ago

Is there a log or something that I can send you? Cause as far as I know everything is download successfully.

riderkick commented 9 years ago

How if you only download one chapter that is not compressed to pdf?

There's is no log if there is no error. Tell me exactly what you're trying to download. Title, website, chapter. I'll check it.

ghost commented 9 years ago

How if you only download one chapter that is not compressed to pdf?

Just tested this, seems to not work still.

I was downloading Chihayafuru Chapter 90 on MangaStream. It might work if I try other sites, but those others sites don't always download everything into pdfs either.

riderkick commented 9 years ago

On 0.9.15.0 I change the exception to save to fmd.log, but that's if the compress method is faired. If it's not faired that's mean the download is incomplete.

ghost commented 9 years ago

Here's what shown

Program exception! Application : Free Manga Downloader Version : 0.9.15.0 Product Version : Win64 Debug FPC Version : 3.1.1 LCL Version : 1.5 Target CPU_OS : x86_64_Win64 Host Machine : Windows 7 64-bit Path : C:\Users\Arik\Desktop\fmd_0.9.14.1_Win64\fmd.exe Proccess Id : 1252 Thread Id : 9956 Time : 6/7/2015 15:34:53 Ignored Exception : EImagingError,ERegExpr Sender Class : TPacker Exception Class : EAccessViolation Message : DoPdf.Exception Access violation Exception Address : $000000010011F968 $000000010011C9A6 $000000010011CF50 $000000010011D446 $000000010011C766 $000000010011B1D8 $00000001003B27D2 line 329 of ../baseunits/uImg2Pdf.pas $00000001003B304A line 409 of ../baseunits/uImg2Pdf.pas $0000000100347956 line 133 of ../baseunits/uPacker.pas $0000000100347B4E line 165 of ../baseunits/uPacker.pas $000000010030EF02 line 1238 of ../baseunits/uDownloadsManager.pas $0000000100312B7F line 1591 of ../baseunits/uDownloadsManager.pas $000000010006169F $0000000100003356 line 63 of md.lpr $0000000100013AC9 $0000000077B459CD $0000000077C7B981

riderkick commented 9 years ago

It seems there is some unsupported image type. I will check it later.

ghost commented 9 years ago

Sure, thanks.

Appreciate the help.

riderkick commented 9 years ago

I can't find Chihayafuru on MangaStre am?

ghost commented 9 years ago

Uh that's weird, FMD says MangaStream To

http://www.mangastream.to/chihaya-full.html

Seems that chapter 90 is jpg while the rest are png.

riderkick commented 9 years ago

Because there is Manga Stream.com

ghost commented 9 years ago

Ah yeah I see.

riderkick commented 9 years ago

It seems it's related to Imaging library. It doesn't work correctly with latest fpc. Very hard to trace, this library is big. I'm trying to look alternative library. For a moment just save it to cbz, there is many manga reader available.

ghost commented 9 years ago

Alright then, I'll save to cbz and then convert it to pdf through another program.

Thanks for the help!

riderkick commented 9 years ago

In 32bit it even make the main thread freeze. There is something wrong with the asm code, which is not compatible with latest fpc.

ghost commented 9 years ago

Hm I see, if it helps you in any way, this doesnt just happen with MangaStream.

riderkick commented 9 years ago

Of course, it's affected to all website. There is some special bits on image that make it unrecognized.

riderkick commented 9 years ago

Could you try to lower the compression level, 99 for example. It seems this error only occurred with lossless compression. I'll try to look at it again tomorrow.

ghost commented 9 years ago

99 is fine yeah.

riderkick commented 9 years ago

I've been fixed all related issue to pdf compression with this commit https://github.com/riderkick/FMD/commit/1eedd6ddebad88f7009132143f55c807217df989, https://github.com/riderkick/FMD/commit/74cbb3afd9ee835a4e5760daf78998cf203782d5, https://github.com/riderkick/FMD/commit/ee6b68a4ed2f3c613dea4fd7ee9e7c3aae28a803

In lossless compression, I ignore jpeg images to be compressed to FlateDecode, because it's supported by default for pdf. So, it's better to use lossless compression, except if you use compression quality lower then decent quality (75-85). Larger compression quality will grow the size of images, probably larger than original size, usually original image using around 75-85.

ghost commented 9 years ago

Thanks!