Forums / Setup & design / how to make new image handler

how to make new image handler

Author Message

Marek TryliƄski

Tuesday 27 May 2008 6:08:15 am

hi

i need to have an image class, that rotates images, do two layers, one in greyscale etc

i made in php a proper function

and i added it to standard image gd handler in lib directory

how can i clear the kernel and move my code outside lib directory?

i tried this:

in image.ini

#[ImageConverterSettings]
#ExtensionList[]=ws_image
#ImageConverters[]
#ImageConverters[]=WS

#[WS]
#Name=WS
#IsEnabled=true
#Handler=ezimagegd

can you help me?

this is my function (that works in ez)

function przypinka( $imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData )
{
$polaroid=imagecreatefrompng('/var/plain_site/storage/polaroid.png');
$polaroidSzary=imagecreatefrompng('/var/plain_site/storage/polaroid.png');
$tlo=imagecreatefrompng('/var/plain_site/storage/tlo.png');
$tloBig=imagecreatefrompng('/var/plain_site/storage/tloBig.png');
$plaster=imagecreatefrompng('/var/plain_site/storage/plaster.png');
$tloKolor=imagecolorallocate($tlo,241,241,241);
$szary=$imageObject;
$kolor=$imageObject;
imagecopy($tlo, $polaroid, 24, 42, 0,0,252,237); //wkleja ramke na tlo
imagecopy($tlo, $szary, 34, 53, 0,0,229,213); //wkleja zdjecie swiadka do tla
$zastap = imagecolorallocate($tlo, 241, 241, 241);
imagecolortransparent($tlo,$zastap);
imagefilter($tlo,IMG_FILTER_GRAYSCALE);
$zastap = imagecolorallocate($tlo, 240, 240, 240);
imagecolortransparent($tlo,$zastap);
imagecopy($polaroid, $kolor, 10, 11, 0,0,229,213); //wkleja zdjecie swiadka do ramki
$polaroid=imagerotate($polaroid, 8,-1); // obreca ramke ze zdjeciem
$szer=ImageSX($polaroid); $wys=ImageSY($polaroid);//potrzebne bo obracanie zmienia rozmiar obrazka
imagecopy($tlo, $polaroid, 0, 9, 0,0,$szer,$wys); //wkleja obrocona ramke do tla
imagecopy($tlo, $plaster, 154, 10,0,0,120,90); //wkleja plasterek
imageantialias($tlo, true);
imagecopyresampled($tloBig,$tlo,0,0,0,0,560,560,280,280);
imagecopyresampled($tlo,$tloBig,0,0,0,0,280,280,560,560);
$tloSzare=imagecreatetruecolor(280,280);
$szarosc = imagecolorallocate($tloSzare, 248, 248, 248);
imagefill($tloSzare, 0, 0, $szarosc);
imagecopyresampled($tloSzare,$tlo,0,0,0,0,280,280,280,280);
return $tloSzare;
}

--
http://trylik.pl/kategorie/ez-publish/

eZ debug

Timing: Jan 18 2025 10:39:38
Script start
Timing: Jan 18 2025 10:39:38
Module start 'content'
Timing: Jan 18 2025 10:39:39
Module end 'content'
Timing: Jan 18 2025 10:39:39
Script end

Main resources:

Total runtime1.0301 sec
Peak memory usage4,096.0000 KB
Database Queries183

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 587.7109180.8359
Module start 'content' 0.00670.8968 768.5469450.0859
Module end 'content' 0.90350.1265 1,218.6328333.8203
Script end 1.0301  1,552.4531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.4174210.0002
Check MTime0.00170.1659210.0001
Mysql Total
Database connection0.00110.103610.0011
Mysqli_queries0.958092.99501830.0052
Looping result0.00160.15671810.0000
Template Total0.996196.720.4980
Template load0.00320.313920.0016
Template processing0.992896.380020.4964
Template load and register function0.00020.020110.0002
states
state_id_array0.00080.077510.0008
state_identifier_array0.00080.078020.0004
Override
Cache load0.00280.2707510.0001
Sytem overhead
Fetch class attribute can translate value0.00160.150820.0008
Fetch class attribute name0.00060.058810.0006
XML
Image XML parsing0.00040.036220.0002
class_abstraction
Instantiating content class attribute0.00000.000410.0000
General
dbfile0.00230.2243210.0001
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 10
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs