fixed image resize logic
Details
Details
Preparations
In the index.php, after $application->Init();, place following code:
$image_helper = $application->recallObject('ImageHelper'); echo '<img src="' . $image_helper->ResizeImage(FULL_PATH . IMAGES_PATH . '904x791.png', 120, 120) . '"/>'; echo '<img src="' . $image_helper->ResizeImage(FULL_PATH . IMAGES_PATH . '904x792.png', 120, 120) . '"/>';
Testing
- place attached files 904x791.png, and 904x792.png to the /system/images folder
- open website's Front-End
- confirm that both 904x791.png and 904x792.png images are displayed and resized to 120x105
Diff Detail
Diff Detail
- Repository
- rINP In-Portal
- Branch
- /in-portal/branches/5.2.x
- Lint
Lint OK - Unit
No Unit Test Coverage - Build Status
Buildable 938 Build 938: arc lint + arc unit
Event Timeline
This comment was removed by erik.
Comment Actions
Opening Front-End gives me these PHP warnings:
Warning (#1): rename(.../tmp/uploaded_xPjaG1.jpg,.../system/images/904x791.png): No such file or directory in ...\core\units\helpers\upload_helper.php on line 135 Warning (#2): rename(.../tmp/uploaded_zXuFcJ.jpg,.../system/images/904x792.png): No such file or directory in ...\core\units\helpers\upload_helper.php on line 135
I guess this happens, because D371 isn't applied. Anyway please rewrite test plan to use \ImageHelper::ResizeImage method directly and then verify images from URLs, that mentioned method will return.