Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ImageWorkshopLayer.php #14

Closed
wants to merge 1 commit into from
Closed

Conversation

mbeech
Copy link

@mbeech mbeech commented Aug 18, 2013

Fixing a bug when adding a layer on top after resizing with converse proportions.

To recreate the bug:

$watermark = PHPImageWorkshop\ImageWorkshop::initFromPath('watermark.png');
$watermark->opacity(20);

$image = PHPImageWorkshop\ImageWorkshop::initFromPath('image.png');
$image->resizeInPixel(770, 770, true, 0, 0, 'MM');
$image->addLayerOnTop($watermark);

Expected result:
image.png resized to 770 x 770px with the watermark on top with opacity 20%

Actual result:
blank image resized to 770 x 770px with the watermark on top with opacity 20%

Fixing a bug when adding a layer on top after resizing with converse proportions
@Sybio
Copy link
Owner

Sybio commented Aug 21, 2013

Hello @mbeech you found a beautiful bug !

But you can't apply a mergeAll, because users do not necessarily want to have merged layers (if the layer has sublayers, sublayers have to be distinct, and not all merged in one after a resize).

Anyway, thank you for reporting the bug and proposing a solution, I'm working on a fix ;)

@mbeech
Copy link
Author

mbeech commented Aug 30, 2013

Hi Sybio

Yes I did think that, but I tried so much that was the only thing I could get working! Let me know if you need any help with the fix.

Thanks

@mbeech mbeech closed this Aug 30, 2013
@Sybio
Copy link
Owner

Sybio commented Sep 11, 2013

Hi @mbeech,

The bug is now fixed, and sublayers preserved ;) d7dee53

@mbeech
Copy link
Author

mbeech commented Sep 24, 2013

Good work! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants