Welcome to the forum, Guest

TOPIC: Ability to pick a region of a page to be the cover

Ability to pick a region of a page to be the cover 5 months 2 weeks ago #5926



Fresh Boarder

Posts: 1

Karma: 0

I have a fair bit of manga in my library. A lot of Japanese releases tend not to have a particularly exciting cover on the book itself, but have the artwork on a dust jacket, so rather than cropping this down to just a cover image, some of my collection tends to have scans of the entire dust jacket.

This means you will have an image laid out generally like this:

For most manga, the part in green second from the left is the actual cover. For stuff that is in a western-style layout, eg manga that has been flipped, or just something that happened to also have a similar dust jacket, it's going to be the yellow part second from the right in yellow will be the cover.

Right now, what happens is that when the cover thumbnail is generated, an image like this is assumed to be in landscape format (which technically it is) so the image gets resized to 640px wide and then saved like that. Theoretically you could go in after the fact, edit the cover and crop down to the part that you actually want to display, then replace the image with the cropped one, but because we saved the thumbnail at 640px wide, for some cases I've found where the left and right inner flaps of the jacket are quite large, the image might only be 250-280px tall, so there's a pretty significant loss of quality in the image, especially if you scale the cropped cover back up to 480px wide (standard for portrait-orientation covers).

What actually happens when these cover images are shown in the library view is that the cover image gets displayed centered, so what ends up showing up is the thumbnail image, centered, as the cover. So basically the center of the cover image will be taken up by the spine of the jacket, and you will get a small sliver of the left hand side of the cover and the right side of the back.

Incidentally it looks like this was probably deliberate, the images get scaled to a height of what looks to be 236px and then displayed centered in what looks to be a 156px x236px frame, at least on my machine (unsure if other factors at play here) so as a result, images that were portrait orientation but 'fatter' than the target ratio will also have the extreme left and right of the image cut off, though this isn't too noticeable unless you're taking sceengrabs and zooming in.

Further to that, if you open up the properties for a given comic, the cover image preview there has the image aligned left, so generally you will get most of the pink area which often has stuff like a table of contents or an artist bio or the like. So what you see in this dialog is different to what you see in the actual library as well.

Complicating things even more, there are cases where stuff does get broken down, but not completely, eg you will get the cover and the inner flap as one image, or the cover + inner flap + spine, or sometimes you get the front and back as one image. Because of the fact that the flap sizes are not necessarily the same (usually they are for a given book but not always), and that the actual size changes a lot from one to the next, I don't think it's at all feasible to try and automatically detect the right part of the image - you could try doing something like slice it down the middle then attempt to do edge detection looking for a horizontal line denoting the edge of the spine, and use that as the right hand boundary (or left for non-managa) but even then it would be an approximation.

My suggestion instead is to update the cover page picker in the Edit Comic dialog so that you can bring up a crop dialog that shows the image preview and allows you to click and drag the selected page's image left and right. This would move an internal offset for the left side of the image, starting from 0 and going up to width of the image - your cover size. I haven't done the exact math to figure it out but a quick napkin calculation suggests it's fairly easy I think - scale the image in memory to say 726px tall and then the left side offset of the cover rect would be in the range of 0..width-480px. There's a lot of ways to implement the UI side of it.

And yes, I know I could go in and just modify the cover images directly, but at least for my collection this would involve a multi-step process of finding the thumbnail cover, going from there back to the source image, cropping and resizing, saving it into the covers list with the correct filename, and then repeating this hundreds of times. Plus repeating the process every time i add anything as well. Would be really nice to be able to just do this with a couple clicks inside the program itself.

I may actually have a go at implementing this myself and send a Pull Request if I can get everything building and so on correctly, though it's been a good decade or so since I did anything in Qt so might take a bit.
The administrator has disabled public write access.

Ability to pick a region of a page to be the cover 5 months 1 week ago #5940



Fresh Boarder

Posts: 10

Thank you received: 1

Karma: 0

I've suggested something like this a couple months ago. Good to see I'm not the only one interested in this feature :)
The administrator has disabled public write access.
Powered by Kunena Forum