croptool icon indicating copy to clipboard operation
croptool copied to clipboard

Allow cropping SVG files. Resulting file is also an SVG.

Open bawolff opened this issue 1 year ago • 5 comments

This doesn't actually remove any image data, just change what part of the image is shown. Rotation is not supported.

Fixes #89

bawolff avatar May 04 '24 05:05 bawolff

When I started working on this, I didn't notice there was a WIP svg branch. However it looks like we both had the same general idea for how to implement.

bawolff avatar May 04 '24 05:05 bawolff

Cool, it would be really nice to have SVG support! You'r implementation looks good to me, but I'm not very familiar with SVG (which is probably also why I never completed by branch). When I tested this PR with a few random SVG files, I found one that doesn't seem to be cropped right: https://commons.wikimedia.org/wiki/File:Bisec-examples-1.svg Can you have a quick look to see if you understand why?

If I make this selection:

image

The preview looks like this: Skjermbilde 2024-05-12 kl  23 05 28

danmichaelo avatar May 12 '24 21:05 danmichaelo

Whoops, looks like I made an error in my math. I divided the numbers in the wrong order so it was multiplying by the wrong ratio. Most files the ratio between user units and actual pixels is 1:1, so it won't matter, but if that's not true then it was cropping them wrong. I added a commit to my branch to fix the error

bawolff avatar May 12 '24 21:05 bawolff

@danmichaelo Just a friendly reminder ping :)

bawolff avatar May 30 '24 13:05 bawolff

@danmichaelo just a friendly reminder ping.

bawolff avatar Jul 07 '24 17:07 bawolff

@bawolff Sorry for the wait, I've tested the branch a bit now and it seems to work really well!

danmichaelo avatar Jul 28 '24 21:07 danmichaelo

Thank you :)

bawolff avatar Jul 29 '24 00:07 bawolff