Open jcogs-design opened 1 year ago
Same question here. I want to crop an image below and above, same pixels in both sides. For this, I calc $positionY = ($finalHeigh - $originalImageHeight) / 2) and the result value is always negative. So, Imagine Point class returns an Exception. There are a reason to not allowing negative values in Point class? Thanks!
There is another class, equivalent to Point class, that allows negative values.
Imagine\Image\PointSigned
It works.
Anyway, I would like to understand why Point doesn't allow negative values.
The PointSigned
class was added in #663
Anyway, I would like to understand why Point doesn't allow negative values.
I think because in many usages of this class, negative values are not allowed.
Issue description
The Imagine Point class constrains point values to be positive (vis
Why is this? Is there a work-around for positioning drawn or pasted image objects so that they are partially placed outside of an image area?
If you disable the constraint, it appears that Imagine continues to work OK with negative values.
What version of Imagine are you using?
1.3.2
What's the PHP version you are using?
8.0.25
What's the imaging library you are using [gd/imagick/gmagick/any]?
GD2
What's the imaging library configuration
GD Version: "2.3.3" FreeType Support: true FreeType Linkage: "with freetype" GIF Read Support: true GIF Create Support: true JPEG Support: true PNG Support: true WBMP Support: true XPM Support: true XBM Support: true WebP Support: true BMP Support: true TGA Read Support: true JIS-mapped Japanese Font Support: false
Minimal PHP code to reproduce the error:
n/a