File: goto.php

package info (click to toggle)
php4-imagick 0.9.11-0.2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 720 kB
  • ctags: 755
  • sloc: ansic: 4,373; php: 1,574; sh: 1,226; makefile: 82; awk: 27
file content (26 lines) | stat: -rw-r--r-- 759 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?
        $handle = imagick_readimage( getcwd() . "/animated.gif" ) ;
        if ( imagick_iserror( $handle ) )
        {
                $reason      = imagick_failedreason( $handle ) ;
                $description = imagick_faileddescription( $handle ) ;

                print "handle2 failed!<BR>\nReason: $reason<BR>\nDescription: $description<BR>\n" ;
                exit ;
        }

	imagick_next( $handle ) ;
	imagick_next( $handle ) ;
	imagick_next( $handle ) ;
	imagick_next( $handle ) ;
	imagick_goto( $handle, 0 ) ;

	//
	//  Extract just the current image from the list.
	//

	$new_handle = imagick_getimagefromlist( $handle ) ;

	header( "Content-type: " . imagick_getmimetype( $new_handle ) ) ;
	print imagick_image2blob( $new_handle ) ;
?>