MechTechnology / SmartStitch

A small program for stitching together webtoons/manhwa/manhua raws.
MIT License
72 stars 27 forks source link

Increasing Image size limit #21

Open sashakeista opened 1 year ago

sashakeista commented 1 year ago

Can you increase the limit to be more than 178k pixels? For example to 200k or 300k. Thanks

AbhiMayadam commented 1 year ago

That is a limit within Pillow, the image library that is used for SmartStitch. Bypassing this limit for Pillow is possible as noted here. https://stackoverflow.com/questions/51152059/pillow-in-python-wont-let-me-open-image-exceeds-limit.

Also, very large images cannot be loaded properly within browsers or other longstrip comic viewing frameworks, so I do not recommend such large images. Even Photoshop PSB files have a limit of 300,000 pixels in any dimension.

image

sashakeista commented 1 year ago

What I meant is the input image pixel limit, the one that I want to increase the pixel limit. For example I have 200000px and I want them to be slice into 4500px per image. It says "could be decompression bomb DOS Attack".

AbhiMayadam commented 1 year ago

What I meant is the input image pixel limit, the one that I want to increase the pixel limit. For example I have 200000px and I want them to be slice into 4500px per image. It says "could be decompression bomb DOS Attack".

Now I understand. Your input image is 200,000 pixels tall. (a. Who makes a 200k pixel tall image in the first place?)

If you have Photoshop on your computer, what you can do is make a canvas that's the correct image width and half of the height of your final image. Place the image on so it's correctly sized and half of the image doesn't show on the canvas so you only see the top half, export that, and repeat for the bottom half. You can put these into smart stitch and it will slice them like normal.

That edge case would have to be taken into consideration as that's a Pillow limit, not something that Mech coded in.

Ill try adding it in and making a PR