★ wanayoo — archive 1999 http://www.php.net/manual/de/function.imagecreatefromjpeg.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Grafiken
Quick Reference
English version of this pageJapanese version of this pageItalian version of this pageHungarian version of this page
Grafiken
* GetImageSize
* ImageArc
* ImageChar
* ImageCharUp
* ImageColorAllocate
* ImageColorAt
* ImageColorClosest
* ImageColorDeAllocate
* ImageColorExact
* ImageColorResolve
* ImageColorSet
* ImageColorsForIndex
* ImageColorsTotal
* ImageColorTransparent
* ImageCopy
* ImageCopyResized
* ImageCreate
* ImageCreateFromGIF
* ImageCreateFromJPEG
* ImageCreateFromPNG
* ImageDashedLine
* ImageDestroy
* ImageFill
* ImageFilledPolygon
* ImageFilledRectangle
* ImageFillToBorder
* ImageFontHeight
* ImageFontWidth
* ImageGammaCorrect
* ImageGIF
* ImageJPEG
* ImagePNG
* ImageInterlace
* ImageLine
* ImageLoadFont
* ImagePolygon
* ImagePSBBox
* ImagePSEncodeFont
* ImagePsExtendFont
* ImagePSFreeFont
* ImagePSLoadFont
* ImagePsSlantFont
* ImagePSText
* ImageRectangle
* ImageSetPixel
* ImageString
* ImageStringUp
* ImageSX
* ImageSY
* ImageTTFBBox
* ImageTTFText
* ImageTypes
Manual: ImageCreateFromJPEG
View the source code for this pageSearch the site



Previous page
 ImageCreateFromGIF
 Updated
Sat, 12 Aug 2000
ImageCreateFromPNG 
Next page


ImageCreateFromJPEG

(unknown)

ImageCreateFromJPEG --  Erzeugt ein neues Bild im JPEG-Format, welches aus einer Datei oder von einer URL gelesen wird

Beschreibung:

int imagecreatefromjpeg (string filename)

ImageCreateFromJPEG() gibt den Bezeichner auf ein Bild zurück, der das aus der angegebenen Datei eingelesene Bild darstellt.

Im Fehlerfall gibt ImageCreateFromJPEG() eine leere Zeichenkette zurück. Zudem wird eine Fehlermeldung erzeugt, die im Browser als Verbindungsabbruch dargestellt wird. Zum besseren Debuggen wird das folgende Beispiel einen JPEG-Fehler erzeugen:

Beispiel 1. Beispiel, um die Handhabung eines Fehlers bei der Bilderzeugung zu sehen (Dank an vic@zymsys.com):


function LoadJpeg ($imgname) {
    $im = @ImageCreateFromJPEG ($imgname); /* Versuch, Datei zu öffnen */
    if (!$im) {                            /* Prüfen, ob fehlgeschlagen */
        $im = ImageCreate (150, 30);       /* Erzeugen eines leeren Bildes */
        $bgc = ImageColorAllocate ($im, 255, 255, 255);
        $tc  = ImageColorAllocate ($im, 0, 0, 0);
        ImageFilledRectangle ($im, 0, 0, 150, 30, $bgc); 
        /* Ausgabe einer Fehlermeldung */
        ImageString($im, 1, 5, 5, "Fehler beim Öffnen von: $imgname", $tc); 
    }
    return $im;
}
     

User Contributed Notes: ImageCreateFromJPEG


jeff@zaius.org
04-Jul-2000 11:38
After spending many, many hours trying to make this work, I realized that it is not supported until version 3.0.16. So, if you're having problems, check to see what version of PHP you have. You must also have version 1.8 or higher of gd, which means that you cannot have gif and jpeg support in the same installation of PHP (easily).


cveld@bigfoot.com
09-Jul-2000 10:42
Can someone tell me how I can create an image from a string with a jpeg-stream in it?



burdav@cs.felk.cvut.cz
16-Jul-2000 04:04
Hi!
can anyone tell me where can I find some help about how to make gd-1.8.3 and php4 to work together? I have debian linux potato and I have install apache-1.3 and php4 from .deb packages but there is only gd-1.7 and I need ImageCreateFromJpeg()... thax



rodders_plonker@yahoo.com
21-Jul-2000 08:49
To all those having trouble with a message to the effect of:

CreateImageFromJpeg() not supported in this PHP build

Start by adding --with-jpeg-dir to your ./configure options as I left this out (not knowing I needed it) and I spent the best part of 6 hours trying to compile to get this option. (RH 6.2, PHP 4.0.1pl2, Apache 1.3.12, GD 1.8.3)



toddb@apptechsys.com
15-Aug-2000 02:01
Can anyone tell me how to make this work with windows? I'm fine on a BSD box, but it isn't supported with my windows distribution.


 About Notes


Previous page
 ImageCreateFromGIF
 Updated
Sat, 12 Aug 2000
ImageCreateFromPNG 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.