Page MenuHomeIn-Portal Phabricator

INP-1772 Don't use "/tmp" folder, when resizing uploaded images
ClosedPublic

Authored by erik on Jun 26 2019, 6:40 AM.

Details

Summary

fixed resize logic to avoid image lost

Test Plan

Preparations

In the index.php, after $application->Init();, place following code:

$upload_helper = $application->recallObject('kUploadHelper');
$upload_helper->resizeUploadedFile(FULL_PATH . IMAGES_PATH . '120x105.png', 'resize:120x120');
$upload_helper->resizeUploadedFile(FULL_PATH . IMAGES_PATH . '904x791.png', 'resize:120x120');

Testing

  1. place attached file 120x105.png (dimensions: 120x105) to the /system/images/ folder
  2. place attached file 904x791.png (dimensions: 904x791) to the /system/images/ folder
  3. open website's Front-End
  4. confirm that 120x105.png is in place and not changed it's size
  5. confirm that 904x791.png is resized to 120x105 (if D370 is applied) or 121x106 (if D370 is not applied)

Diff Detail

Repository
rINP In-Portal
Branch
/in-portal/branches/5.2.x
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 939
Build 939: arc lint + arc unit

Event Timeline

erik created this revision.Jun 26 2019, 6:40 AM
erik requested review of this revision.Jun 26 2019, 6:40 AM
erik edited the test plan for this revision. (Show Details)Jun 26 2019, 6:40 AM
alex added a project: Restricted Project.Jun 26 2019, 8:46 AM
alex edited the test plan for this revision. (Show Details)Jun 26 2019, 8:51 AM
erik edited the test plan for this revision. (Show Details)Jun 26 2019, 9:41 AM
alex accepted this revision.Jun 27 2019, 4:49 AM
alex edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Jun 27 2019, 4:49 AM
This revision was automatically updated to reflect the committed changes.