Skip to content

Update ImageWorkshopLayer.php#14

Closed
mbeech wants to merge 1 commit into
Sybio:masterfrom
mbeech:master
Closed

Update ImageWorkshopLayer.php#14
mbeech wants to merge 1 commit into
Sybio:masterfrom
mbeech:master

Conversation

@mbeech
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Owner

Sybio commented Sep 11, 2013

Hi @mbeech,

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

@mbeech
Copy link
Copy Markdown
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