Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hi,

    I have the same problem since 2 weeks ago.

    I edit to know which value has $h,

    print('current height: '.$current_height);
    print('ratio: '.$ratio);
    $h = max( 1, (int) round( $current_height * $ratio ) );

    and the print was this: current height: 105 ratio: 1 current height: 105 ratio: 0.77319587628866 current height: ratio: 0.97

    So the last print current height is nothing, that’s why replay that there is no value encountered. I decide to make this solution:

    // Very small dimensions may result in 0, 1 should be the minimum.
    if($current_height === ''){ $current_height = 1;}
    $w = max( 1, (int) round( $current_width * $ratio ) );
    $h = max( 1, (int) round( $current_height * $ratio ) );

    And works!

    • This reply was modified 3 years, 8 months ago by roddom67.
    • This reply was modified 3 years, 8 months ago by roddom67.
Viewing 1 replies (of 1 total)