php.de

Zurück   php.de > Webentwicklung > PHP-Fortgeschrittene

PHP-Fortgeschrittene Arbeiten mit PHP ohne Einschränkungen

Antwort
 
LinkBack Themen-Optionen Thema bewerten
Alt 13.12.2004, 21:49  
Benutzer
 
Registriert seit: 15.09.2004
Beiträge: 57
pixelcut
Standard Problem mit Wasserzeichen auf Bildern

Hallo ihr lieben,

ich habe für ein Projekt den i-rater Platinum v3 gekauft (www.i-rater.com)
Diese kommt standardmäßig mit einer Möglichkeit, upgeloadete Bilder
mit einem Wasserzeichen zu versehen. Der Bildupload funktioniert
auch ohne Probleme (alles wunderbar), nur sobald das "watermarken"
angeschalten ist, erscheinen nur noch dekorative rote X'e, es wird also
nichts mehr angezeigt....

Laut der Doku werden die Module

--with-gd
--with-jpeg-dir
--with-ttf
--with-freetype-dir

benötigt, die - soweit ich sehe in der phpinfo - auch alle vorhanden
sind in der Konfiguration. Hat eventuell jemand einen Ansatz woran
es liegen könnte?
pixelcut ist offline   Mit Zitat antworten
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 13.12.2004, 22:00  
Gast
 
Beiträge: n/a
Standard

Ich kann ohne weitere Daten nichts herausfinden. Gibt es in deiner i-rater Platinum v3 vielleicht einen Bug?
  Mit Zitat antworten
Alt 13.12.2004, 22:19  
Benutzer
 
Registriert seit: 15.09.2004
Beiträge: 57
pixelcut
Standard

Hi Michigras,

welche Daten benötigst du? Nein, ein Bug sollte nicht vorhanden sein,
in der Demo läuft es auch einwandfrei. Nur mein Server / php macht
Probleme. Vorab herzlichen Dank!
pixelcut ist offline   Mit Zitat antworten
Alt 13.12.2004, 22:23  
Benutzer
 
Registriert seit: 15.09.2004
Beiträge: 57
pixelcut
Standard

hier aber mal die image.php, die das bewerstelligen "soll"

PHP-Code:
<?php

include("./admin/config.php");
include(
"$include_path/common.php");

global 
$HTTP_POST_VARS,$HTTP_GET_VARS,$HTTP_SESSION_VARS;

global 
$_SESSION;

if (
$HTTP_POST_VARS!="")
    
$_POST=$HTTP_POST_VARS;

if (
$HTTP_GET_VARS!="")
    
$_GET=$HTTP_GET_VARS;

if (
$HTTP_SESSION_VARS!="")
    
$_SESSION=$HTTP_SESSION_VARS;


if(!isset(
$_GET['id']))
{
    
header("Location: $base_url/");
    exit();
}

if(!isset(
$_GET['p']))
{
    
$_GET['p']=1;        
}

    
$image1 $image_path "/" $_GET['id'] . "_" $_GET['p'] .  "." "jpg"
    
$image2 $image_path "/" $_GET['id'] . "_" $_GET['p'] .  "." "JPG"
    
$image3 $image_path "/" $_GET['id'] . "_" $_GET['p'] .  "." "JPEG"
    
$image4 $image_path "/" $_GET['id'] . "_" $_GET['p'] .  "." "jpeg"
    
$image5 $image_path "/" $_GET['id'] . "_" $_GET['p'] .  "." "png"
    
$image6 $image_path "/" $_GET['id'] . "_" $_GET['p'] .  "." "PNG"
    
$image7 $image_path "/" $_GET['id'] . "_" $_GET['p'] .  "." "GIF"
    
$image8 $image_path "/" $_GET['id'] . "_" $_GET['p'] .  "." "gif"


    if (
file_exists($image1))
    {
       
$image_name $image1 ;
       
$ext="jpg";    
    }
    elseif (
file_exists($image2))
    {
       
$image_name $image2 ;
       
$ext="JPG";    
    }
    elseif (
file_exists($image3))
    {
       
$image_name $image3 ;
       
$ext="JPEG";    
    }
    elseif (
file_exists($image4))
    {
       
$image_name $image4 ;
       
$ext"jpeg";     
    }
    elseif (
file_exists($image5))
    {
       
$image_name $image5 ;
       
$ext="png";    
    }
    elseif (
file_exists($image6))
    {
       
$image_name $image6 ;
       
$ext "PNG";      
    }
    elseif (
file_exists($image7))
    {
       
$image_name $image7 ;
       
$ext ="GIF";    
    }
    elseif (
file_exists($image8))
    {
       
$image_name $image8 ;
       
$ext="gif";     
    }


/*    $sql = "
    select
        average_rating,
        image_ext,
        concat(id,'_',1,'.',image_ext) as image
    from
        $tb_users
    where
        id = '$_GET[id]' and total_files > 0
    ";
    //echo $sql;

    $query = mysql_query($sql) or die(mysql_error());
    $array = mysql_fetch_array($query);
*/
;

    switch(
$ext)
    {
        case 
"jpg":
        case 
"jpeg":
        case 
"JPG":
        case 
"JPEG":
            
$ext "jpeg";
            break;
        case 
"png":
        case 
"PNG":
            
$ext "png";
            break;
        case 
"gif":
        case 
"GIF":
            
$ext "gif";
            break;
    }

    
$image $image_name;

    if(
$watermark_images== "yes")
    {

        switch(
$ext)
        {
            case 
"jpg":
            case 
"jpeg":
            case 
"JPG":
            case 
"JPEG":
                
$im imagecreatefromjpeg($image);
                break;
            case 
"png":
            case 
"PNG":
                
$im imagecreatefrompng($image);
                break;
            case 
"gif":
            case 
"GIF":
                
$im imagecreatefromgif($image);
                break;
        }

        
$height imagesy($im);
        
$width imagesx($im);

        if (!
$im
        {
              
/* See if it failed */
           
                
$im  imagecreate (15030); /* Create a blank image */
                
$bgc imagecolorallocate ($im255255255);
                
$tc  imagecolorallocate ($im000);
                
imagefilledrectangle ($im0015030$bgc);
           
                 
/* Output an errmsg */
                
imagestring ($im155"Error loading $imgname"$tc);
            }
    
            
$white imagecolorallocate ($im255255255);
            
$white1 imagecolorallocate ($im100,100,100);
    
//echo " WATER     $watermark_text  $font_path "; exit;
//            $nwidth= abs($width - strlen($watermark_text) * 20);
            
$nwidthabs($width strlen($watermark_text) * 10);
            
$nwidth=$nwidth/2;    

        if(
$width >= 170)
        {
             
//imagettftext(&$im, 15, 0, $nwidth, $height - 10, $white, "$font_path/ARIAL.TTF", $watermark_text);
            //imagettftext(&$im, 15, 0, $nwidth + 1, $height - 11, $white1, "$font_path/ARIAL.TTF", $watermark_text);
                    //imagettftext($im, 15, 0, $nwidth, $height - 10, $white, "$font_path/ARIAL.TTF", $watermark_text);
            //imagettftext($im, 15, 0, $nwidth + 1, $height - 11, $white1, "$font_path/ARIAL.TTF", $watermark_text);
            
imagestring($im5$nwidth$height-30$watermark_text$white);
            
imagestring($im5$nwidth+1$height-31$watermark_text$white1);


        }
        else 
        {
             
//imagettftext(&$im, 9, 0, 10, $height - 11, $white, "$font_path/ARIAL.TTF", $watermark_text);
            //imagettftext(&$im, 9, 0, 9, $height - 12, $white1, "$font_path/ARIAL.TTF", $watermark_text);
             //imagettftext($im, 9, 0, 10, $height - 11, $white, "$font_path/ARIAL.TTF", $watermark_text);
            //imagettftext($im, 9, 0, 9, $height - 12, $white1, "$font_path/ARIAL.TTF", $watermark_text);
            
imagestring($im510$height-30$watermark_text$white);
            
imagestring($im59$height-31$watermark_text$white1);

        }

        
ob_start();

        
header("Content-type: image/" $ext);

        switch(
$ext)
        {
             case 
"jpg":
            case 
"jpeg":
            case 
"JPG":
            case 
"JPEG":
                 
imagejpeg($im''97);
                break;
            case 
"png":
            case 
"PNG":
                
imagepng($im''97);
                break;
            case 
"gif":
            case 
"GIF":
                
imagegif($im''97);
                break;
        }
        
        
imagedestroy($im);

    }
    else
    {
       
readfile($image);
    }

?>

Auf dem Server läuft die PHP Version 4.3.9-1
pixelcut ist offline   Mit Zitat antworten
Alt 13.12.2004, 22:40  
Gast
 
Beiträge: n/a
Standard Re: Problem mit Wasserzeichen auf Bildern

Zitat:
Zitat von pixelcut
ich habe für ein Projekt den i-rater Platinum v3 gekauft (www.i-rater.com)
...
Hat eventuell jemand einen Ansatz woran
es liegen könnte?
Was sagen denn die Script-Autoren zu Deinem Problem?
  Mit Zitat antworten
Alt 13.12.2004, 22:43  
Benutzer
 
Registriert seit: 15.09.2004
Beiträge: 57
pixelcut
Standard

Leider halten die sich bedeckt in Irland. Supportanfragen brachten eine
Erfolgsquote von 0,00 % Ich dachte zunächst eher an ein Problem
mit der PHP-Konfiguration / mit den Modulen.
pixelcut ist offline   Mit Zitat antworten
Alt 13.12.2004, 23:51  
Gast
 
Beiträge: n/a
Standard

Zitat:
Leider halten die sich bedeckt in Irland.
Pech. Ich verwende Gallery. Kostet nix und ist sehr komfortabel. Habe eben mal die Wasserzeichenfunktion getestet - klappert auch. Erfordert ImageMagick und Shellzugriff.

GDLIB-Info:
Array
(
[GD Version] => bundled (2.0.28 compatible)
[FreeType Support] => 1
[FreeType Linkage] => with freetype
[T1Lib Support] => 1
[GIF Read Support] => 1
[GIF Create Support] => 1
[JPG Support] => 1
[PNG Support] => 1
[WBMP Support] => 1
[XPM Support] => 1
[XBM Support] => 1
[JIS-mapped Japanese Font Support] =>
)
  Mit Zitat antworten
Alt 13.12.2004, 23:54  
Benutzer
 
Registriert seit: 15.09.2004
Beiträge: 57
pixelcut
Standard

Vollen Zugriff habe ich, liegt auf eigener Serverfarm, wie bekomme ich raus ob ImageMagick vorhanden ist? bzw. was fehlt? Vielen Dank schon mal
pixelcut ist offline   Mit Zitat antworten
Alt 14.12.2004, 00:08  
Gast
 
Beiträge: n/a
Standard

Zitat:
Zitat von pixelcut
Vollen Zugriff habe ich, liegt auf eigener Serverfarm, wie bekomme ich raus ob ImageMagick vorhanden ist? bzw. was fehlt?
ImageMagick:
Code:
convert --help
PHP:
Als Beispiel mal mein Configurestring, mit dem ich PHP 5.0.2 compiliert habe
Code:
./configure \
    --prefix=/usr \
    --with-apxs2=/usr/sbin/apxs2 \
    --bindir=/usr/bin \
    --libdir=/usr/lib \
    --with-config-file-path=/etc \
    --enable-track-vars \
    --enable-magic-quotes \
    --enable-versioning \
    --disable-debug \
    --with-mysql=/usr \
    --enable-ftp \
    --with-zlib \
    --enable-trans-sid \
    --enable-ctype \
    --enable-sockets \
    --enable-calendar \
    --enable-wddx \
    --enable-bcmath \
    --enable-pcntl \
    --with-openssl=/usr \
    --with-open-dir=/usr \
    --enable-exif \
    --enable-ctype \
    --with-bz2=/usr \
    --with-mcrypt \
    --with-mhash \
    --with-imap=/usr \
    --with-imap-ssl=/usr \
    --enable-inline-optimization \
    --with-zlib-dir=/usr \
    --with-jpeg-dir=/usr \
    --with-png-dir=/usr \
    --with-gd \
    --enable-gd-native-ttf \
    --with-xpm-dir=/usr/X11R6 \
    --with-ttf=/usr \
    --with-freetype-dir=/usr \
    --with-t1lib \
    --with-tiff-dir=/usr \
    --enable-memory-limit \
    --enable-shmop \
    --enable-sysvsem \
    --enable-sysvshm \
    --with-zip \
    --with-pgsql=/usr \
    --with-pdflib=/usr \
    --enable-inline-optimization \
    --with-libxml-dir=/usr \
    --with-tidy \
    --with-gdbm \
    --enable-dba \
    --with-gettext=/usr \
    --enable-simplexml \
    ;
  Mit Zitat antworten
Alt 14.12.2004, 00:13  
Benutzer
 
Registriert seit: 15.09.2004
Beiträge: 57
pixelcut
Standard

Das gibt er mir aus....

Code:
ImageMagick 6.0.6 10/26/04 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2004 ImageMagick Studio LLC

Usage: convert [options ...] file [ [options ...] file ...] [options ...] file

Where options include:
  -adjoin              join images into a single multi-image file
  -affine matrix       affine transform matrix
  -annotate geometry text
                       annotate the image with text
  -antialias           remove pixel-aliasing
  -append              append an image sequence
  -authenticate value  decrypt image with this password
  -average             average an image sequence
  -background color    background color
  -black-threshold value
                       forces all pixels below the threshold into black
  -blue-primary point  chromaticity blue primary point
  -blur geometry       blur the image
  -border geometry     surround image with a border of color
  -bordercolor color   border color
  -channel type        Red, Green, Blue, Opacity, Index, Cyan, Yellow,
                       Magenta, Black, or All
  -charcoal radius     simulate a charcoal drawing
  -chop geometry       remove pixels from the image interior
  -clip                clip along the first path from the 8BIM profile
  -clip-path id        clip along a named path from the 8BIM profile
  -clone index         clone an image
  -coalesce            merge a sequence of images
  -colorize value      colorize the image with the fill color
  -colors value        preferred number of colors in the image
  -colorspace type     alternate image colorspace
  -combine             combine a sequence of images
  -comment string      annotate image with comment
  -compose operator    composite image
  -compress type       image compression type
  -contrast            enhance or reduce the image contrast
  -convolve coefficients
                       apply a convolution kernel to the image
  -crop geometry       preferred size and location of the cropped image
  -cycle amount        cycle the image colormap
  -debug events        display copious debugging information
  -define format:option
                       define one or more image format options
  -deconstruct         break down an image sequence into constituent parts
  -delay value         display the next image after pausing
  -delete index        delete the image from the image sequence
  -density geometry    horizontal and vertical density of the image
  -depth value         image depth
  -despeckle           reduce the speckles within an image
  -display server      get image or font from this X server
  -dispose method      Undefined, None, Background, Previous
  -dither              apply Floyd/Steinberg error diffusion to image
  -draw string         annotate the image with a graphic primitive
  -edge radius         apply a filter to detect edges in the image
  -emboss radius       emboss an image
  -encoding type       text encoding type
  -endian type         LSB or MSB
  -enhance             apply a digital filter to enhance a noisy image
  -equalize            perform histogram equalization to an image
  -evaluate operator value
                       evaluate an arithmetic, relational, or logical expression
  -extract geometry    extract area from image
  -fill color          color to use when filling a graphic primitive
  -filter type         use this filter when resizing an image
  -flatten             flatten a sequence of images
  -flip                flip image in the vertical direction
  -flop                flop image in the horizontal direction
  -family name         render text with this font family
  -font name           render text with this font
  -frame geometry      surround image with an ornamental border
  -fuzz distance       colors within this distance are considered equal
  -fx expression       apply mathematical expression to an image channel(s)
  -gamma value         level of gamma correction
  -gaussian geometry   gaussian blur an image
  -geometry geometry   perferred size or location of the image
  -green-primary point chromaticity green primary point
  -gravity type        horizontal and vertical text placement
  -help                print program options
  -implode amount      implode image pixels about the center
  -insert index        insert last image into the image sequence
  -intent type         Absolute, Perceptual, Relative, or Saturation
  -interlace type      None, Line, Plane, or Partition
  -label name          assign a label to an image
  -lat geometry        local adaptive thresholding
  -level value         adjust the level of image contrast
  -limit type value    Area, Disk, Map, or Memory resource limit
  -log format          format of debugging information
  -loop iterations     add Netscape loop extension to your GIF animation
  -map filename        transform image colors to match this set of colors
  -mask filename       set the image clip mask
  -matte               store matte channel if the image has one
  -mattecolor color    frame color
  -median radius       apply a median filter to the image
  -modulate value      vary the brightness, saturation, and hue
  -monochrome          transform image to black and white
  -morph value         morph an image sequence
  -mosaic              create a mosaic from an image sequence
  -negate              replace every pixel with its complementary color
  -noise radius        add or reduce noise in an image
  -normalize           transform image to span the full range of colors
  -opaque color        change this color to the fill color
  -ordered-dither NxN
                       ordered dither the image
  -orient type         image orientation
  -page geometry       size and location of an image canvas (setting)
  -paint radius        simulate an oil painting
  -ping                efficiently determine image attributes
  -pointsize value     font point size
  -posterize levels    reduce the image to a limited number of color levels
  -preview type        image preview type
  -profile filename    add, delete, or apply an image profile
  -quality value       JPEG/MIFF/PNG compression level
  -radial-blur angle   radial blur the image
  -raise value         lighten/darken image edges to create a 3-D effect
  -random-threshold low,high
                       random threshold the image
  -region geometry     apply options to a portion of the image
  -raise value         lighten/darken image edges to create a 3-D effect
  -red-primary point   chromaticity red primary point
  -render              render vector graphics
  -repage geometry     size and location of an image canvas (operator)
  -resample geometry   change the resolution of an image
  -resize geometry     resize the image
  -roll geometry       roll an image vertically or horizontally
  -rotate degrees      apply Paeth rotation to the image
  -sample geometry     scale image with pixel sampling
  -sampling-factor geometry
                       horizontal and vertical sampling factor
  -scale geometry      scale the image
  -scene value         image scene number
  -seed value          pseudo-random number generator seed value
  -segment values      segment an image
  -separate            separate an image channel into a grayscale image
  -shade degrees       shade the image using a distant light source
  -sharpen geometry    sharpen the image
  -shave geometry      shave pixels from the image edges
  -shear geometry      slide one edge of the image along the X or Y axis
  -size geometry       width and height of image
  -solarize threshold  negate all pixels above the threshold level
  -splice geometry     splice the background color into the image
  -spread amount       displace image pixels by a random amount
  -strip               strip image of all profiles and comments
  -stroke color        graphic primitive stroke color
  -strokewidth value   graphic primitive stroke width
  -stretch type        render text with this font stretch
  -style type          render text with this font style
  -support factor      resize support: > 1.0 is blurry, < 1.0 is sharp
  -swap indexes        swap two images in the image sequence
  -swirl degrees       swirl image pixels about the center
  -texture filename    name of texture to tile onto the image background
  -threshold value     threshold the image
  -thumbnail geometry  create a thumbnail of the image
  -tile filename       tile image when filling a graphic primitive
  -tint value          tint the image with the fill color
  -transform           affine transform image
  -transparent color   make this color transparent within the image
  -treedepth value     color tree depth
  -trim                trim image edges
  -type type           image type
  -undercolor color    annotation bounding box color
  -units type          PixelsPerInch, PixelsPerCentimeter, or Undefined
  -unsharp geometry    sharpen the image
  -verbose             print detailed information about the image
  -version             print version information
  -view                FlashPix viewing transforms
  -virtual-pixel method
                       Constant, Edge, Mirror, or Tile
  -wave geometry       alter an image along a sine wave
  -weight type         render text with this font weight
  -white-point point   chromaticity white point
  -white-threshold value
                       forces all pixels above the threshold into white
  -write filename      write images to this file

By default, the image format of `file' is determined by its magic
number.  To specify a particular image format, precede the filename
with an image format name and a colon (i.e. ps:image) or specify the
image type as the filename suffix (i.e. image.ps).  Specify 'file' as
'-' for standard input or output.
pixelcut ist offline   Mit Zitat antworten
Antwort


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
[Erledigt] Galerie Problem... coraplanet PHP Tipps 2008 4 06.06.2008 13:42
Wasserzeichen nixdorf HTML, Usability und Barrierefreiheit 0 22.10.2007 16:43
datensätze defekt oder problem mit dem einlesen? Ministry Datenbanken 4 06.07.2006 18:42
Problem mit Darstellung von Bildern >100K LP Server, Hosting und Workstations 43 20.02.2006 22:50
problem!!! PHP Tipps 2006 6 08.02.2006 11:06
[Erledigt] wieder ein Problem bei phpmailer und smtp PHP Tipps 2006 24 07.02.2006 01:07
Problem bei Bildern aus blobs PHP-Fortgeschrittene 6 06.01.2006 22:23
Problem mit der Ausrichtung von Bildern HTML, Usability und Barrierefreiheit 8 26.08.2005 19:16
Smarty und PHP-Skript Problem PHP Tipps 2004-2 2 03.12.2004 22:27
Problem mit Fotogalere PHP Tipps 2004-2 4 23.11.2004 22:37
PHP Upload (Master Value/Local Value Problem) PHP-Fortgeschrittene 5 23.11.2004 07:21
Problem mit alter JavaScript-Funktion woods PHP Tipps 2004 1 13.08.2004 13:34
[Erledigt] Problem mit Timestamp! PHP Tipps 2004 24 08.06.2004 19:51
Login Problem PHP Tipps 2004 4 04.06.2004 18:46
foreach problem mAy^daY PHP Tipps 2004 3 02.06.2004 20:29

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
pdflib wasserzeichen, imagemagick wasserzeichen, wie bekomme ich wasserzeichen aus fotos raus, php timestamp wasserzeichen, wasserzeichen schreiben mit pdflib, pdflib watermark, php imagick kontrast, wasserzeichen mit imagick, imagettftext watermark, tranzparentes imagettftext php watermark, gdlib wasserzeichen fehler, spaw bildupload php, php text wasserzeichen, php bilder blob wasserzeichen, imagecycle wasserzeichen, 8bim grayscale imagecreatefromjpeg, string wasserzeichen, donnerstag 15.09 wasserzeichen, wasserzeichen pdflib, wasserzeichen imagemagick

Alle Zeitangaben in WEZ +1. Es ist jetzt 20:58 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.