View Issue Details

IDProjectCategoryView StatusLast Update
0003080OXID eShop (all versions)4.07. Source code, Testpublic2012-12-10 13:44
Reportertjungcl 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionPast development 
Target VersionFixed in Version4.5.2 revision 38481 
Summary0003080: oxdynimggenerator doesnt preserve image ratio
Descriptionthe new generator from svn generates pictures always in the predefined dimensions, not preserving the original image ratio.

to fix, in oxdynimggenerator.php add:

    protected function _preserveRatio($iWidth,$iHeight,$sSource){
        $aImageInfo = @getimagesize($sSource);
        $ratio = $aImageInfo[0]/$aImageInfo[1];
        if ($iWidth/$iHeight > $ratio) {
           $iWidth = $iHeight * $ratio;
        } else {
           $iHeight = $iWidth / $ratio;
        }
        return array($iWidth,$iHeight);
    }

and in the function _generateImage, after list($iWidth...) = ...;
add
list( $iWidth, $iHeight) = $this->_preserveRatio($iWidth,$iHeight,$sImageSource);
TagsNo tags attached.
ThemeBoth
BrowserAll
PHP Versionany
Database Versionany

Activities

arvydas_vapsva

2011-08-03 16:52

reporter   ~0004927

fixed in one of the latest commits