XHanch Studio Log in | Register | Cart

Forum

[How to] Create/sav...
 
Notifications
Clear all

[How to] Create/save a JPG/JPEG image as progressive JPG/JPEG

1 Posts
1 Users
0 Likes
13.2 K Views
XHanch
(@xhanch-alt)
Posts: 2105
Member Admin
Topic starter
 

To create a progressive JPG/JPEG image or to save a JPG/JPEG image as progressive JPG/JPEG, you just need to use imageinterlace function.
Syntax:

imageinterlace($img_res, true);

Here's an example to use this function:

<?php
    // Create an image instance
    $img = imagecreatefromjpeg('test.jpg');
    // Enable interlancing
    imageinterlace($img, true);

    // Save the interlaced image
    imagejpeg($img, './test-result.jpg');
    imagedestroy($img);
?>

To learn more about progressive JPEG:
http://forum.xhanch.com/index.php/topic,2655.0.html

 
Posted : 15/03/2012 12:21 am
Share:

× Close Menu