Tiff images / conversion to display in browser

Author Message

Roman Mudrack

Wednesday 19 May 2004 7:42:42 am

hi,

referring to this : http://ez.no/community/forum/developer/tiff_images_media

i tried to implement a module which converts the tiff to a jpg.
but it quits with this error :
Fatal error: Call to undefined function: registertype()

code :

 
include_once ('lib/ezimage/classes/ezimagemanager.php');
include_once ('lib/ezimage/classes/ezimageshell.php');

$img =& eZImageManager::instance();
echo $img;
// Register a shell converter using "convert", we name it "convert"
$img->registerType( "convert", new eZImageShell( '', "convert", array(), array(), array() ) );
// Register a converter which uses the PHP extension ImageGD
$img->registerType( "gd", new eZImageGD() );


// Create the JPEG type
$jpeg_type = $img->createMIMEType( "image/jpeg", "\.jpe?g$", "jpg");

$img->setMIMETypes( array( $jpeg_type) );

// Create rule
$tiff2jpg_rule = $img->createRule( "image/tiff", "image/jpg",
"convert", false, false );
// Register the rule and setup the default rule
$img->setRules( array( $tiff2jpg_rule ),
$img->createRule( "*", "image/jpg", "convert",
false, false ) );

// We only want JPEG images
$img->setOutputTypes( array( "mime/jpeg" ) );

$source = "/../../tiff.bin";
$dest_img = $img->convert( $source, "var/cache/" );
print( "<img src="/$dest_img">" );

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 04:18:42
Script start
Timing: Jan 31 2025 04:18:42
Module start 'layout'
Timing: Jan 31 2025 04:18:42
Module start 'content'
Timing: Jan 31 2025 04:18:42
Module end 'content'
Timing: Jan 31 2025 04:18:42
Script end

Main resources:

Total runtime0.0120 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0041 588.2656151.2266
Module start 'layout' 0.00410.0017 739.492236.6797
Module start 'content' 0.00580.0047 776.171990.2031
Module end 'content' 0.01050.0015 866.375029.9922
Script end 0.0120  896.3672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002016.6209140.0001
Check MTime0.00108.1455140.0001
Mysql Total
Database connection0.00075.704010.0007
Mysqli_queries0.001915.935030.0006
Looping result0.00000.083510.0000
Template Total0.00119.310.0011
Template load0.00097.330310.0009
Template processing0.00021.892710.0002
Override
Cache load0.00065.038010.0006
General
dbfile0.001512.125780.0002
String conversion0.00000.039840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs