Note that there are some explanatory texts on larger screens.

plurals
  1. POGDs' imageflip() is not working - code just stops
    primarykey
    data
    text
    <p>I'm trying to flip an image with php gd function <code>imageflip()</code>. I have GD installed. I'm using WAMP and codeigniter on Windows. (and it's kind of difficult to implement imagemagick on wamp - so I would prefer not to). imageflip() should work as I see it. I'm using PHP version 5.4.16. </p> <p>Maybe I'm missing something...</p> <p>from <code>phpinfo()</code>:</p> <p><strong>gd</strong></p> <pre><code>GD Support enabled GD Version bundled (2.1.0 compatible) FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.4.10 GIF Read Support enabled GIF Create Support enabled JPEG Support enabled libJPEG Version 8 PNG Support enabled libPNG Version 1.2.50 WBMP Support enabled XPM Support enabled libXpm Version 30411 XBM Support enabled Directive Local Value Master Value gd.jpeg_ignore_ warning 0 0 </code></pre> <p><em><strong>I have this code:</em></strong></p> <pre><code>foreach($products_settings as &amp;$ps) { $filename = $_SERVER['DOCUMENT_ROOT'] . $ps['product_file']; $source_image = imagecreatefromjpeg($filename); //Put source image-resource into array $ps['source_image'] = $source_image; } </code></pre> <p><strong>and it works..</strong></p> <p>When I use <code>imagerotate()</code> it <strong>works</strong> as well...</p> <pre><code>foreach($products_settings as &amp;$ps) { $filename = $_SERVER['DOCUMENT_ROOT'] . $ps['product_file']; $source_image = imagecreatefromjpeg($filename); //rotate image $angle = $ps['product_angle']; if (intval($angle) &lt;&gt; 0) { $source_image = imagerotate($source_image, 360-$angle, imageColorAllocateAlpha($source_image, 255, 255, 255, 127)); } //Put source image-resource into array $ps['source_image'] = $source_image; } </code></pre> <p><strong>...BUT</strong> when I use imageflip ( <a href="http://php.net/manual/en/function.imageflip.php" rel="nofollow">http://php.net/manual/en/function.imageflip.php</a> )</p> <pre><code>foreach($products_settings as &amp;$ps) { $filename = $_SERVER['DOCUMENT_ROOT'] . $ps['product_file']; $source_image = imagecreatefromjpeg($filename); imageflip($source_image, IMG_FLIP_BOTH); //code execution stops here //Put source image-resource into array $ps['source_image'] = $source_image; } </code></pre> <p>then the <code>imageflip()</code> makes the code stop (If I add log message the row after it doesn't log). I can't figure out WHY? What would be the reason for that? I can't see anything in errorlogs in codeigniter/php/apache. The manual says that the function will return false when fail, but I know the image is correct because I'm using other gd function for the same image with other gd-functions (as <code>imagerotate</code>, <code>imageColorAllocateAlpha</code> etc)</p> <p>I've also tried this:</p> <pre><code>try { imageflip($source_image, IMG_FLIP_BOTH); } catch (Exception $e) { log_message('DEBUG', 'img err' . $e-&gt;__toString()); } </code></pre> <p>But nothings get logged...</p> <p>How to debug this?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload