Page MenuHomeIn-Portal Phabricator

INP-1719 - Only resize fully uploaded file
ClosedPublic

Authored by alex on Jul 23 2017, 5:47 AM.

Details

Test Plan
IMPORTANT: Don't test until D320 is committed.

Part 1 (flash uploader, without storage format)

  • in IDE:
    1. open /modules/in-commerce/units/manufacturers/manufacturers_config.php file for editing
    2. remove storage_format field option (if any) in Logo field declaration
    3. save changes
  • in Admin Console:
    1. go to E-commerceManufacturers section
    2. click on Add button on toolbar
    3. click Browse button for Logo image field and select 300x300 image
    4. confirm, that image was uploaded and thumbnail of 100x100 size is shown
    5. close item adding window

Part 2 (flash uploader, with storage format)

  • in IDE:
    1. open /modules/in-commerce/units/manufacturers/manufacturers_config.php file for editing
    2. add storage_format field option with 'resize:150x200;crop:C|C' value to Logo field declaration
    3. save changes
  • in Admin Console:
    1. go to E-commerceManufacturers section
    2. click on Add button on toolbar
    3. click Browse button for Logo image field and select 300x300 image
    4. confirm, that image was uploaded and thumbnail of 75x100 size is shown
    5. close item adding window

Part 3

  1. repeat test from Part 1, but use image that filesize is 1.5MB or more, but proportions, but width and height are the same
  2. repeat test from Part 2, but use image that filesize is 1.5MB or more, but proportions, but width and height are the same

Diff Detail

Repository
rINP In-Portal
Branch
/in-portal/branches/5.2.x
Lint
Lint ErrorsExcuse: Well tested code. Better not to change.
SeverityLocationCodeMessage
Errorcore/units/helpers/upload_helper.php:249PHPCS.E.CodingStandard.ControlStructures.AssignmentInCondition.ForbiddenCodingStandard.ControlStructures.AssignmentInCondition.Forbidden
Errorcore/units/helpers/upload_helper.php:259PHPCS.E.CodingStandard.ControlStructures.AssignmentInCondition.ForbiddenCodingStandard.ControlStructures.AssignmentInCondition.Forbidden
Warningcore/units/helpers/upload_helper.php:249PHPCS.W.CodingStandard.PHP.NoSilencedErrors.DiscouragedCodingStandard.PHP.NoSilencedErrors.Discouraged
Warningcore/units/helpers/upload_helper.php:259PHPCS.W.CodingStandard.PHP.NoSilencedErrors.DiscouragedCodingStandard.PHP.NoSilencedErrors.Discouraged
Unit
No Unit Test Coverage
Build Status
Buildable 807
Build 807: arc lint + arc unit

Event Timeline

alex created this revision.Jul 23 2017, 5:47 AM
alex added inline comments.
core/units/helpers/upload_helper.php
92–96

Later this would be replaced by kUploadHelper::resizeUploadedFile call from D320.

alex edited the test plan for this revision. (Show Details)Jul 23 2017, 5:52 AM
alex edited the test plan for this revision. (Show Details)Jul 23 2017, 5:57 AM
alex added a child revision: Restricted Differential Revision.Jul 23 2017, 6:14 AM
alex updated this revision to Diff 808.EditedJul 26 2017, 10:29 AM

Rebased over changes made in D320. Ready for testing.

alex updated this revision to Diff 809.Jul 26 2017, 10:33 AM
alex marked an inline comment as done.

Rebased over changes made in D320. One change was lost previously.

erik accepted this revision.Aug 3 2017, 5:48 AM
This revision is now accepted and ready to land.Aug 3 2017, 5:48 AM
This revision was automatically updated to reflect the committed changes.