When specifying where to crop, wand crops at the wrong place. This is the code I am using to produce the following images.
from wand.color import Color
from wand.display import display
from wand.drawing import Drawing
from wand.image import Image
i = Image(filename=r'../../data/wtf.png')
with Drawing() as draw:
draw.stroke_width = 2
draw.stroke_color = Color('red')
draw.line((158, 0), (150, i.height))
draw(i)
display(i)
i.crop(left=158)
display(i)
This is the source image that I am trying to crop.
The 158th pixel that I am trying to crop at can be drawn correctly and is located left of the C in Carthage.
But when I try to crop it with i.crop(left=158) it doesn't crop there, instead cropping around 195.
This doesn't seem to recur with some other images. I'm not sure why this one specifically is causing problems.
This problem does not happen if I convert the image into PIL, crop it, and then convert it back.
When specifying where to crop,
wandcrops at the wrong place. This is the code I am using to produce the following images.This is the source image that I am trying to crop.
The 158th pixel that I am trying to crop at can be drawn correctly and is located left of the C in Carthage.
But when I try to crop it with
i.crop(left=158)it doesn't crop there, instead cropping around 195.This doesn't seem to recur with some other images. I'm not sure why this one specifically is causing problems.
This problem does not happen if I convert the image into PIL, crop it, and then convert it back.