Success

User tests: Successful: Unsuccessful:

avatar piotr-cz
piotr-cz
19 Jul 2013

New scaling method: Scale to fit given boundaries.
result is centered vertically to center and horizontally to middle.

Issue tracker: #31527

Usage

// Load up image
$img = new JImage(JPATH_SITE . '/images/powered_by.png');

// Resize
$img->resize(96, 96, JImage::SCALE_FIT);

// Save new image to file
$img->toFile(JPATH_SITE . '/images/joomla_powered_by_resized.jpg', IMAGETYPE_JPEG, array('quality' => 85));

Example

Original image (150x35)
powered_by

Scaled to 96x96
powered_by_transparent

Scaled to 96x96 and used backgorundfill filter (see #1562)
powered_by_white

avatar piotr-cz piotr-cz - open - 19 Jul 2013
avatar mbabker mbabker - reference | - 28 Sep 13
avatar mbabker mbabker - merge - 28 Sep 2013
avatar mbabker mbabker - close - 28 Sep 2013
avatar piotr-cz
piotr-cz - comment - 1 Oct 2013

Unfortunately I discovered a bug in the package that shows up after this PR.
I've updated the commit in the Framework, but this PR has been merged before I synced it.

What should I do now?

  • commit patch here
  • create new pull request
avatar mbabker
mbabker - comment - 1 Oct 2013

New PR

avatar piotr-cz
piotr-cz - comment - 1 Oct 2013

Thanks. Seems that on Framework I've problem too.

avatar piotr-cz piotr-cz - head_ref_deleted - 2 Oct 2013
avatar garyamort garyamort - reference | - 2 Dec 13

Add a Comment

Login with GitHub to post a comment