Skip to content

[BUG]: Phalcon\Image\Adapter\Gd -> Crop image using offset = 0px #16156

Open
@zzplab

Description

@zzplab

Describe the bug
When I crop an image I want to use offset 0px, but that causes the image to crop in the CENTER of the image.
When I crop an image and use offset 1px, it works fine.

To Reproduce
Steps to reproduce the behavior:

<?php

use Phalcon\Image\Adapter\Gd;

$image = new Gd('image.jpg');

$width   = 100;
$height  = 100;
$offsetX = 0;
$offsetY = 0;

$image->crop($width, $height, $offsetX, $offsetY);

$image->save('crop-image.jpg');

Expected behavior
When I use offset 0px I expect the image to be cropped from 0px from the edge.

Details

  • Phalcon version: 5.0.3
  • PHP Version: 8.1.11
  • Operating System:
  • Installation type: cPanel using Pecl install.
  • Server: Apache

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions