watermerk code

Gestart doorKrm10 reacties45 weergaven

11 berichten · pagina 1 van 1

Krm

Lid · Topicstarter

Berichten
6.235
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Waarom doet dit code dit?

[COLOR= #0000BB]<?php[/COLOR] 
[COLOR= #FF8000]// this script creates a watermarked image from an image file - can be a .jpg .gif or .png file 
// where watermark.gif is a mostly transparent gif image with the watermark - goes in the same directory as this script 
// where this script is named watermark.php 
// call this script with an image tag 
// <img src="watermark.php?path=imagepath"> where path is a relative path such as subdirectory/image.jpg [/COLOR]
[COLOR= #0000BB]$imagesource[/COLOR] [COLOR= #007700]=[/COLOR]  [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]path[/COLOR][COLOR= #007700]];[/COLOR] 
[COLOR= #0000BB]$filetype[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/substr"]substr[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$imagesource[/COLOR][COLOR= #007700],[/COLOR][URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$imagesource[/COLOR][COLOR= #007700])-[/COLOR][COLOR= #0000BB]4[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]4[/COLOR][COLOR= #007700]);[/COLOR] 
[COLOR= #0000BB]$filetype[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strtolower"]strtolower[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$filetype[/COLOR][COLOR= #007700]);[/COLOR] 
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$filetype[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]".gif"[/COLOR][COLOR= #007700])[/COLOR]  [COLOR= #0000BB]$image[/COLOR] [COLOR= #007700]= @[/COLOR]imagecreatefromgif[COLOR= #007700]([/COLOR][COLOR= #0000BB]$imagesource[/COLOR][COLOR= #007700]);[/COLOR]  
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$filetype[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]".jpg"[/COLOR][COLOR= #007700])[/COLOR]  [COLOR= #0000BB]$image[/COLOR] [COLOR= #007700]= @[/COLOR]imagecreatefromjpeg[COLOR= #007700]([/COLOR][COLOR= #0000BB]$imagesource[/COLOR][COLOR= #007700]);[/COLOR]  
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$filetype[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]".png"[/COLOR][COLOR= #007700])[/COLOR]  [COLOR= #0000BB]$image[/COLOR] [COLOR= #007700]= @[/COLOR]imagecreatefrompng[COLOR= #007700]([/COLOR][COLOR= #0000BB]$imagesource[/COLOR][COLOR= #007700]);[/COLOR]  
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$image[/COLOR][COLOR= #007700])[/COLOR] [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]();[/COLOR] 
[COLOR= #0000BB]$watermark[/COLOR] [COLOR= #007700]= @[/COLOR]imagecreatefromgif[COLOR= #007700]([/COLOR][COLOR= #DD0000]images/watermark.gif[/COLOR][COLOR= #007700]);[/COLOR] 
[COLOR= #0000BB]$imagewidth[/COLOR] [COLOR= #007700]=[/COLOR] imagesx[COLOR= #007700]([/COLOR][COLOR= #0000BB]$image[/COLOR][COLOR= #007700]);[/COLOR] 
[COLOR= #0000BB]$imageheight[/COLOR] [COLOR= #007700]=[/COLOR] imagesy[COLOR= #007700]([/COLOR][COLOR= #0000BB]$image[/COLOR][COLOR= #007700]);[/COLOR]  
[COLOR= #0000BB]$watermarkwidth[/COLOR] [COLOR= #007700]=[/COLOR]  imagesx[COLOR= #007700]([/COLOR][COLOR= #0000BB]$watermark[/COLOR][COLOR= #007700]);[/COLOR] 
[COLOR= #0000BB]$watermarkheight[/COLOR] [COLOR= #007700]=[/COLOR]  imagesy[COLOR= #007700]([/COLOR][COLOR= #0000BB]$watermark[/COLOR][COLOR= #007700]);[/COLOR] 
[COLOR= #0000BB]$startwidth[/COLOR] [COLOR= #007700]= ([/COLOR][COLOR= #0000BB]$imagewidth[/COLOR] [COLOR= #007700]-[/COLOR] [COLOR= #0000BB]$watermarkwidth[/COLOR][COLOR= #007700]);[/COLOR] 
[COLOR= #0000BB]$startheight[/COLOR] [COLOR= #007700]= ([/COLOR][COLOR= #0000BB]$imageheight[/COLOR] [COLOR= #007700]-[/COLOR] [COLOR= #0000BB]$watermarkheight[/COLOR][COLOR= #007700]);[/COLOR]
imagecopy[COLOR= #007700]([/COLOR][COLOR= #0000BB]$image[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$watermark[/COLOR][COLOR= #007700],[/COLOR]  [COLOR= #0000BB]$startwidth[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$startheight[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$watermarkwidth[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$watermarkheight[/COLOR][COLOR= #007700]);[/COLOR] 
imagejpeg[COLOR= #007700]([/COLOR][COLOR= #0000BB]$image[/COLOR][COLOR= #007700]);[/COLOR] 
imagedestroy[COLOR= #007700]([/COLOR][COLOR= #0000BB]$image[/COLOR][COLOR= #007700]);[/COLOR] 
imagedestroy[COLOR= #007700]([/COLOR][COLOR= #0000BB]$watermark[/COLOR][COLOR= #007700]);[/COLOR]
?>


http://raputatie.one2xs.com/test.php?path=http://www.qotile.net/images/lol.jpg
0
Berichten
4.214
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Omdat je header niet als het plaatje staat, nu denkt hij dat het html is terwijl het een plaatje is.

Bijv

header(Content-type: image/gif); (Ik noem maar iets weet niet of het klopt)
0
Krm

Lid · Topicstarter

Berichten
6.235
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
hoe moet dat ik het script dan?
0
Berichten
4.214
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Zorg dat het bestand geen enklen enter of spatie heeft, en plaats dit bovenaan
[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]image/jpeg[/COLOR][COLOR= #007700]);[/COLOR] ?>


dit is voor JPG bestanden wil je png moet je gewoon jpeg verandern in PNG ga maar door

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]// this script creates a watermarked image from an image file - can be a .jpg .gif or .png file
// where watermark.gif is a mostly transparent gif image with the watermark - goes in the same directory as this script
// where this script is named watermark.php
// call this script with an image tag
// <img src="watermark.php?path=imagepath"> where path is a relative path such as subdirectory/image.jpg[/COLOR]
[COLOR= #0000BB]$imagesource[/COLOR] [COLOR= #007700]=[/COLOR]  [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]path[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$filetype[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/substr"]substr[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$imagesource[/COLOR][COLOR= #007700],[/COLOR][URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$imagesource[/COLOR][COLOR= #007700])-[/COLOR][COLOR= #0000BB]4[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]4[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$filetype[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strtolower"]strtolower[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$filetype[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$filetype[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]".gif"[/COLOR][COLOR= #007700]){[/COLOR] [URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]image/gif[/COLOR][COLOR= #007700]);[/COLOR]  [COLOR= #0000BB]$image[/COLOR] [COLOR= #007700]= @[/COLOR]imagecreatefromgif[COLOR= #007700]([/COLOR][COLOR= #0000BB]$imagesource[/COLOR][COLOR= #007700]);  }[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$filetype[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]".jpg"[/COLOR][COLOR= #007700]){[/COLOR] [URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]image/jpeg[/COLOR][COLOR= #007700]);[/COLOR]  [COLOR= #0000BB]$image[/COLOR] [COLOR= #007700]= @[/COLOR]imagecreatefromjpeg[COLOR= #007700]([/COLOR][COLOR= #0000BB]$imagesource[/COLOR][COLOR= #007700]);  }[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$filetype[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]".png"[/COLOR][COLOR= #007700]){[/COLOR] [URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]image/png[/COLOR][COLOR= #007700]);[/COLOR]  [COLOR= #0000BB]$image[/COLOR] [COLOR= #007700]= @[/COLOR]imagecreatefrompng[COLOR= #007700]([/COLOR][COLOR= #0000BB]$imagesource[/COLOR][COLOR= #007700]);  }[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$image[/COLOR][COLOR= #007700])[/COLOR] [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]();[/COLOR]
[COLOR= #0000BB]$watermark[/COLOR] [COLOR= #007700]= @[/COLOR]imagecreatefromgif[COLOR= #007700]([/COLOR][COLOR= #DD0000]images/watermark.gif[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$imagewidth[/COLOR] [COLOR= #007700]=[/COLOR] imagesx[COLOR= #007700]([/COLOR][COLOR= #0000BB]$image[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$imageheight[/COLOR] [COLOR= #007700]=[/COLOR] imagesy[COLOR= #007700]([/COLOR][COLOR= #0000BB]$image[/COLOR][COLOR= #007700]);[/COLOR]  
[COLOR= #0000BB]$watermarkwidth[/COLOR] [COLOR= #007700]=[/COLOR]  imagesx[COLOR= #007700]([/COLOR][COLOR= #0000BB]$watermark[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$watermarkheight[/COLOR] [COLOR= #007700]=[/COLOR]  imagesy[COLOR= #007700]([/COLOR][COLOR= #0000BB]$watermark[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$startwidth[/COLOR] [COLOR= #007700]= ([/COLOR][COLOR= #0000BB]$imagewidth[/COLOR] [COLOR= #007700]-[/COLOR] [COLOR= #0000BB]$watermarkwidth[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$startheight[/COLOR] [COLOR= #007700]= ([/COLOR][COLOR= #0000BB]$imageheight[/COLOR] [COLOR= #007700]-[/COLOR] [COLOR= #0000BB]$watermarkheight[/COLOR][COLOR= #007700]);[/COLOR]
imagecopy[COLOR= #007700]([/COLOR][COLOR= #0000BB]$image[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$watermark[/COLOR][COLOR= #007700],[/COLOR]  [COLOR= #0000BB]$startwidth[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$startheight[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$watermarkwidth[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$watermarkheight[/COLOR][COLOR= #007700]);[/COLOR]
imagejpeg[COLOR= #007700]([/COLOR][COLOR= #0000BB]$image[/COLOR][COLOR= #007700]);[/COLOR]
imagedestroy[COLOR= #007700]([/COLOR][COLOR= #0000BB]$image[/COLOR][COLOR= #007700]);[/COLOR]
imagedestroy[COLOR= #007700]([/COLOR][COLOR= #0000BB]$watermark[/COLOR][COLOR= #007700]);[/COLOR]
?>


Oke, de schoonheidsprijs wint het niet maar dit zou moeten werken xd
0
Berichten
4.214
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]// this script creates a watermarked image from an image file - can be a .jpg .gif or .png file
// where watermark.gif is a mostly transparent gif image with the watermark - goes in the same directory as this script
// where this script is named watermark.php
// call this script with an image tag
// <img src="watermark.php?path=imagepath"> where path is a relative path such as subdirectory/image.jpg[/COLOR]
[COLOR= #0000BB]$imagesource[/COLOR] [COLOR= #007700]=[/COLOR]  [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]path[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$filetype[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/substr"]substr[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$imagesource[/COLOR][COLOR= #007700],[/COLOR][URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$imagesource[/COLOR][COLOR= #007700])-[/COLOR][COLOR= #0000BB]4[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]4[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$filetype[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strtolower"]strtolower[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$filetype[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$filetype[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]".gif"[/COLOR][COLOR= #007700]){[/COLOR] [URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]image/gif[/COLOR][COLOR= #007700]);[/COLOR]  [COLOR= #0000BB]$image[/COLOR] [COLOR= #007700]= @[/COLOR]imagecreatefromgif[COLOR= #007700]([/COLOR][COLOR= #0000BB]$imagesource[/COLOR][COLOR= #007700]);  }[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$filetype[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]".jpg"[/COLOR][COLOR= #007700]){[/COLOR] [URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]image/jpeg[/COLOR][COLOR= #007700]);[/COLOR]  [COLOR= #0000BB]$image[/COLOR] [COLOR= #007700]= @[/COLOR]imagecreatefromjpeg[COLOR= #007700]([/COLOR][COLOR= #0000BB]$imagesource[/COLOR][COLOR= #007700]);  }[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$filetype[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]".png"[/COLOR][COLOR= #007700]){[/COLOR] [URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]image/png[/COLOR][COLOR= #007700]);[/COLOR]  [COLOR= #0000BB]$image[/COLOR] [COLOR= #007700]= @[/COLOR]imagecreatefrompng[COLOR= #007700]([/COLOR][COLOR= #0000BB]$imagesource[/COLOR][COLOR= #007700]);  }[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$image[/COLOR][COLOR= #007700])[/COLOR] [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]();[/COLOR]
[COLOR= #0000BB]$watermark[/COLOR] [COLOR= #007700]= @[/COLOR]imagecreatefromgif[COLOR= #007700]([/COLOR][COLOR= #DD0000]images/watermark.gif[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$imagewidth[/COLOR] [COLOR= #007700]=[/COLOR] imagesx[COLOR= #007700]([/COLOR][COLOR= #0000BB]$image[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$imageheight[/COLOR] [COLOR= #007700]=[/COLOR] imagesy[COLOR= #007700]([/COLOR][COLOR= #0000BB]$image[/COLOR][COLOR= #007700]);[/COLOR]  
[COLOR= #0000BB]$watermarkwidth[/COLOR] [COLOR= #007700]=[/COLOR]  imagesx[COLOR= #007700]([/COLOR][COLOR= #0000BB]$watermark[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$watermarkheight[/COLOR] [COLOR= #007700]=[/COLOR]  imagesy[COLOR= #007700]([/COLOR][COLOR= #0000BB]$watermark[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$startwidth[/COLOR] [COLOR= #007700]= ([/COLOR][COLOR= #0000BB]$imagewidth[/COLOR] [COLOR= #007700]-[/COLOR] [COLOR= #0000BB]$watermarkwidth[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$startheight[/COLOR] [COLOR= #007700]= ([/COLOR][COLOR= #0000BB]$imageheight[/COLOR] [COLOR= #007700]-[/COLOR] [COLOR= #0000BB]$watermarkheight[/COLOR][COLOR= #007700]);[/COLOR]
imagecopy[COLOR= #007700]([/COLOR][COLOR= #0000BB]$image[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$watermark[/COLOR][COLOR= #007700],[/COLOR]  [COLOR= #0000BB]$startwidth[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$startheight[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$watermarkwidth[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$watermarkheight[/COLOR][COLOR= #007700]);[/COLOR]
imagejpeg[COLOR= #007700]([/COLOR][COLOR= #0000BB]$image[/COLOR][COLOR= #007700]);[/COLOR]
imagedestroy[COLOR= #007700]([/COLOR][COLOR= #0000BB]$image[/COLOR][COLOR= #007700]);[/COLOR]
imagedestroy[COLOR= #007700]([/COLOR][COLOR= #0000BB]$watermark[/COLOR][COLOR= #007700]);[/COLOR]
?>


Oke, de schoonheidsprijs wint het niet maar dit zou moeten werken xd
0
Krm

Lid · Topicstarter

Berichten
6.235
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nog steeds het zelfde
0
Berichten
4.214
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Kijk mijn edit even
0
Krm

Lid · Topicstarter

Berichten
6.235
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nog steeds zelfde

Als ik hem in de image tags stop werkt ie bedankt biggrin
0
Berichten
4.214
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Omdat de browser dat ziet dat het een image is maar de servers van One2XS denken dat het gewoon HTML / TEXT is
0
Krm

Lid · Topicstarter

Berichten
6.235
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Njah dat boeit me niet ik douw dit ding toch in me ubb systeem
0
Berichten
6.722
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
EDIT:// OEPS! Ik wilde op voorbeeld klikken maar ik klikte op verzenden. bloos
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren