? ? Success

User tests: Successful: Unsuccessful:

avatar Buddhima
Buddhima
24 Mar 2015

Hi All,

This PR is to add flip functionality to JImage class, which is using quite lot in Joomla image manipulations.
Sample usage of this method is as follows:

$JImage = new JImage($file);

try
{
    $image = $JImage->flip($mode, true);
    $image->toFile($file);

    return true;
}
catch (Exception $e)
{
    $app->enqueueMessage($e->getMessage(), 'error');
}

Mode of flipping can have 3 values which are defined in GD library:

  • IMG_FLIP_HORIZONTAL
  • IMG_FLIP_VERTICAL
  • IMG_FLIP_BOTH

Hope this will help for developers to do more with JImage!

Thank you!

avatar Buddhima Buddhima - open - 24 Mar 2015
avatar joomla-cms-bot joomla-cms-bot - change - 24 Mar 2015
Labels Added: ?
avatar C-Lodder
C-Lodder - comment - 24 Mar 2015

Have been trying to test this but constantly getting a blank screen (even with error reporting set to Development).

Wrapped the code in a function and defined the path of an image correctly. Could you please confirm a test you've done with an image that comes shipped with Joomla?

avatar Buddhima
Buddhima - comment - 24 Mar 2015

Hi @C-Lodder ,

Thank you for quick testing. Here's the image results after IMG_FLIP_BOTH mode :

screenshot from 2015-03-24 23 15 20

Also feel free to have a look at PR "[#33906] New Media Manager for Joomla! CMS" which has an actual use-case of this.

Thank you!

avatar C-Lodder
C-Lodder - comment - 24 Mar 2015

@Buddhima - Oh this is for the Media Editor. Sorry, I was adding your code to a custom module of mine to test

avatar Buddhima
Buddhima - comment - 25 Mar 2015

Hi @C-Lodder ,

This is not just for that. Anyone can use this feature quite similar way as rotate, resize etc.
That's the reason why I pushed this separately.
You can have a look at Media Editor for an example use of this.

[ Ref: Buddhima@eed0111
administrator/components/com_media/controller/editor/flip.php calls model's flipImage($id, $mode)
and see model's code : administrator/components/com_media/model/editor.php
]

Thank you!

avatar losedk
losedk - comment - 25 Mar 2015

@test all good. Tested all 3 modes with success

avatar Buddhima
Buddhima - comment - 25 Mar 2015

@losedk , Thank you for testing.

avatar C-Lodder
C-Lodder - comment - 25 Mar 2015

@test all good now :)

avatar Buddhima
Buddhima - comment - 26 Mar 2015

@phproberto Thanks for pointing that out. Can you check the current code?
Thank you!

avatar phproberto
phproberto - comment - 27 Mar 2015

@Buddhima it looks good now. Thanks!

avatar phproberto phproberto - change - 27 Mar 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 27 Mar 2015
Milestone Added:
Status Pending Ready to Commit
avatar zero-24 zero-24 - alter_testresult - 27 Mar 2015 - losedk: Tested successfully
avatar zero-24 zero-24 - alter_testresult - 27 Mar 2015 - phproberto: Tested successfully
avatar zero-24 zero-24 - alter_testresult - 27 Mar 2015 - C-Lodder: Tested successfully
avatar zero-24
zero-24 - comment - 27 Mar 2015

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6571.
avatar zero-24 zero-24 - change - 27 Mar 2015
Category Libraries
avatar brianteeman brianteeman - change - 27 Mar 2015
Labels Added: ?
avatar piotr-cz
piotr-cz - comment - 30 Mar 2015

I'd add information on the $mode parameter in the docblock.
Either short info or reference to [http://php.net/imageflip#refsect1-function.imageflip-parameters]

avatar zero-24 zero-24 - close - 25 May 2015
avatar wilsonge
wilsonge - comment - 25 May 2015

I added a link to the URL you mentioned @piotr-cz during merging into the docblock.

Merged into 3.5 staging. Thanks Buddhima!

avatar wilsonge wilsonge - change - 25 May 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-05-25 00:17:38
Closed_By wilsonge
avatar wilsonge wilsonge - close - 25 May 2015
avatar zero-24 zero-24 - change - 14 Oct 2015
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment