*.GIF - Thumbnails

Tests, Neuerungen und Sonstiges
Antworten
Benutzeravatar
Uwe
Bruchpilot
Bruchpilot
Beiträge: 8207
Registriert: Sonntag 2. März 2003, 00:27
Mein Motorrad: HONDA CX500 EML Gespann, Bj. 1982
Zweit-Motorrad: HONDA CX500, Bj. 1980
PKW: VW GOLF 5 Variant 1.9 TDI DPF
eBay Name: Uwe472
Wohnort: Kreis Segeberg
Hat sich bedankt: 7 Mal
Danksagung erhalten: 2 Mal
Kontaktdaten:

*.GIF - Thumbnails

Beitrag von Uwe »

Hello all,

habe gerade noch ein wenig in SMARTORS Support für unser integriertes Album geblättert und siehe da:
Mit erscheinen der GD-Version 2.0.28 ist es nun auch möglich, Vorschaubilder für GIF-Bilder und GIF-Animationen automatisch erstellen zu lassen und anzuzeigen.
Schnell noch ein paar Programmänderungen und schon ist es auch bei uns möglich.

Hier die Änderungen:
markus_petrux hat geschrieben:Hi all,

First, sorry if this has been already posted, but I only found this thread. :?

I have been testing the following to use jpegs as thumbnails for GIF images. I have used function imagecreatefromgif (which it seems to me it may work with all PHP/GD versions as it is a read-only function) to read the GIF and then, send the image to the browser as jpeg.

It works for me with automatic thumbnails and generates the cached image as jpeg.

Code: Alles auswählen

#
# ---[ OPEN ]----------------
#
album_thumbnail.php

#
# ---[ FIND ]----------------
#
if( ($pic_filetype != '.jpg') and ($pic_filetype != '.png') )

#
# ---[ REPLACE WITH ]----------------
#
if( ($pic_filetype != '.jpg') and ($pic_filetype != '.png') and ($pic_filetype != '.gif') )

#
# ---[ FIND ]----------------
#
case '.jpg':
	header('Content-type: image/jpeg');
	break;

#
# ---[ BEFORE ADD ]----------------
#
case '.gif':

#
# ---[ FIND ]----------------
#
case '.jpg':
	$read_function = 'imagecreatefromjpeg';
	break;

#
# ---[ BEFORE ADD ]----------------
#
case '.gif':
	$read_function = 'imagecreatefromgif';
	$pic_filetype = '.jpg';
	break;

#
# ---[ SAVE ]----------------
#
Can anyone confirm if this is a valid approach? ...or am I lucky with my hosting? :roll:

Thanks
Gruß Uwe
Benutzeravatar
Dirk
PATHFINDER + Moderator
PATHFINDER + Moderator
Beiträge: 5838
Registriert: Freitag 7. März 2003, 19:50
Mein Motorrad: GL500 und 2xGL650 und Ernst Clausen
eBay Name: dex1965
Wohnort: Heidmoor
Danksagung erhalten: 3 Mal
Kontaktdaten:

Beitrag von Dirk »

Alles Klarrrrrr. Ja, superrrrrrr.
Antworten