php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger > PHP Tipps 2005-2

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 17.07.2005, 11:09  
Gast
 
Beiträge: n/a
Standard Thumbnail im IE

Hi all,

im IE funktionieren hier wenn ihr auf Bilder klickt und Miniaturansicht auswählt die Thumbnails nicht. Im Firefox geht es. Woran liegt das? Wenn man allerdings den Thumbnail Code kopiert und in die Adresszeile einfügt, so geht das auch im IE.

Hier mein Code für Thumbnails:

PHP-Code:
<?php

     
/*##############################################
     #          - Thumbnail-Script v1.3 -           #
     # Generating thumbnails 'on-the-fly' with PHP  #
     #                                              #
     #  (c) by Christian Lamine, FlashDreams OHG    #
     #          [url]http://www.flashdreams.de/[/url]          #
     #                                              #
     # This script may be freely used, distributed  #
     # and modified without any charge as long as   #
     # this copyright information is included.      #
     #                                              #
     # Any commercial selling of this script is     #
     # prohibited.                                  #
     #                                              #
     # The author is not responsible for possible   #
     # damage which may result from the application #
     # of this script, neither direct nor indirect. #
     # Use at your own risk!                        #
     ##############################################*/

     
error_reporting(0);

     
$types = array (=> "gif""jpeg""png""swf""psd""wbmp");

     
define ('cache''cache/');

     
$cachedir substr($HTTP_GET_VARS['image'],0,strrpos($HTTP_GET_VARS['image'],'/') + 1).cache;
     !
is_dir ($cachedir)
          ? 
mkdir ($cachedir0777)
          : 
system ("chmod 0777 ".$cachedir);

     (!isset (
$x) || ereg ('^[0-9]{1,}$'$x$regs)) &&
     (!isset (
$y) || ereg ('^[0-9]{1,}$'$y$regs)) &&
     (isset (
$x) || isset ($y))
          ? 
true
          
: DIE ('Fehlende(r) oder ungültige(r) Größenparameter!');

     !isset (
$resize) || !ereg ('^[0|1]$'$resize$regs)
          ? 
$resize 0
          
$resize;

     !isset (
$aspectratio) || !ereg ('^[0|1]$'$aspectratio$regs)
          ? isset (
$x) && isset ($y)
                 ? 
$aspectratio 1
                 
$aspectratio 0
          
$aspectratio;

     !isset (
$image)
          ? DIE (
'Es wurde kein Bild angegeben!')
          : !
file_exists($image)
               ? DIE (
'Die angegebene Datei konnte nicht auf dem Server gefunden werden!')
               : 
false;

     
$imagedata getimagesize($image);

     !
$imagedata[2] || $imagedata[2] == || $imagedata[2] == 5
          
? DIE ('Bei der angegebenen Datei handelt es sich nicht um ein Bild!')
          : 
false;

     eval (
'
     if (!(imagetypes() & IMG_'
.strtoupper($types[$imagedata[2]]).')) {
          DIE ("Das ".strtoupper($types[$imagedata[2]])."-Format wird nicht unterstützt!");
     }
     '
);

     !isset (
$x)
          ? 
$x floor ($y $imagedata[0] / $imagedata[1])
          : 
$x;

     !isset (
$y)
          ? 
$y floor ($x $imagedata[1] / $imagedata[0])
          : 
$y;

     if (
$aspectratio && isset ($HTTP_GET_VARS['x']) && isset ($HTTP_GET_VARS['y'])) {
          if (
$imagedata[0] > $imagedata[1]) {
               
$y floor ($x $imagedata[1] / $imagedata[0]);
          } else if (
$imagedata[1] > $imagedata[0]) {
               
$x floor ($y $imagedata[0] / $imagedata[1]);
          }
     }

     
$thumbfile substr ($HTTP_GET_VARS['image'], strrpos ($HTTP_GET_VARS['image'], '/') + 1);
     if (
file_exists ($cachedir.$thumbfile)) {
          
$thumbdata getimagesize ($cachedir.$thumbfile);
          
$thumbdata[0] == $x && $thumbdata[1] == $y
               
$iscached true
               
$iscached false;
     } else {
          
$iscached false;
     }

     if (!
$iscached) {
          (
$imagedata[0] > $x || $imagedata[1] > $y) ||
          ((
$imagedata[0] < $x || $imagedata[1] < $y) && $resize)
               ? 
$makethumb true
               
$makethumb false;
     } else {
          
$makethumb false;
     }

     
Header ("Content-Type: image/".$types[$imagedata[2]]);

     if (
$makethumb) {
          
$image call_user_func("imagecreatefrom".$types[$imagedata[2]], $image);
          
$thumb imagecreatetruecolor ($x$y);
          
imagecopyresized ($thumb$image0000$x$y$imagedata[0], $imagedata[1]);
          
call_user_func("image".$types[$imagedata[2]], $thumb$cachedir.$thumbfile);
          
imagedestroy ($image);
          
imagedestroy ($thumb);
          
$image $cachedir.$thumbfile;
     } else {
          
$iscached
               
$image $cachedir.$thumbfile
               
$image $HTTP_GET_VARS['image'];
     }
     
$image fopen ($image"rb");
     
fpassthru ($image);
     
fclose ($image);

?>
Is übrigens nich mein eigener.

Danke!

cu Chegga
 
Sponsor Mitteilung
PHP Code Flüsterer

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

Alt 17.07.2005, 15:14  
Moderator
 
Benutzerbild von robo47
 
Registriert seit: 03.09.2004
Beiträge: 11.792
PHP-Kenntnisse:
Fortgeschritten
robo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz sein
Standard

hmm hatte das problem zwischenzeitlich auch mal im FF

ist vieleicht ein problem mit dem webspace weil der immer so komischen mist mit einblenden will, vieleicht akzeptiert der IE das dann nimmer als bild wenns als image-tag definiert ist, vieleicht einfach mal lokal testen
robo47 ist offline  
Alt 17.07.2005, 22:38  
Gast
 
Beiträge: n/a
Standard

mh nee kann eigentlich nicht sein, da thumb.php auf meinem eigenen server liegt ohne werbung und die bilder nur auf tripod gehostet sin.

Was heißt bei dir denn zwischenzeitlich? Haste das dann gelöst oder wie?
 
Alt 17.07.2005, 22:58  
Gast
 
Beiträge: n/a
Standard

Zitat:
$types = array (1 => "gif", "jpeg", "png", "swf", "psd", "wbmp");
Vieleicht liegt es daran, dass der IE PJPEG benutzt.
Aber ist jetzt nur eine Vermutung.
Was ich allerdings etwas komisch finde, sind die Formate bei $type
 
Alt 18.07.2005, 00:05  
Gast
 
Beiträge: n/a
Standard Re: Thumbnail im IE

Zitat:
Zitat von Chegga
Is übrigens nich mein eigener.
Warum fragst Du nicht den Autor Christian Lamine?
 
 


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
Voraussetzungen für dieses Thumbnail Skript Plague PHP Tipps 2008 9 19.09.2007 13:35
erstelltes Thumbnail verpixelt... alisa PHP Tipps 2006 12 23.10.2006 07:28
Thumbnail proportional mit Max. Breite u. Höhe .fox PHP Tipps 2006 3 25.03.2006 07:03
Thumbnail wird nicht generiert. Daskaras PHP Tipps 2006 12 13.03.2006 22:16
Thumbnail (malwieder ich weiss) PHP Tipps 2005-2 4 08.08.2005 19:40
thumbnail erstellen PHP Tipps 2005-2 0 05.08.2005 07:50
Thumbnail erstellen geht nicht Creativ PHP Tipps 2005-2 1 12.07.2005 21:22
Thumbnail PHP Tipps 2005-2 7 10.07.2005 22:18
thumbnail erstellen PHP Tipps 2005 13 15.03.2005 12:54
Thumbnail speichern LdC PHP Tipps 2005 2 06.03.2005 13:40
thumbnail wird farblich flasch dargestellt Filewalker PHP Tipps 2005 4 19.02.2005 17:08
thumbnail erstellung bringt keine (guten) bilder scraddy PHP Tipps 2005 8 06.01.2005 01:24
problem bei thumbnail generieren PHP Tipps 2004-2 3 03.12.2004 18:40
pdf 2 gif|png 2 thumbnail :P PHP-Fortgeschrittene 1 14.09.2004 08:50
array_push nur in begrenzter Anzahl ausführen ? PHP Tipps 2004 2 07.09.2004 09:05

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
ie thumbnails verpixelt, christian lamine resize php, html thumbnail ie gehen nicht, php pdf thumbnail on the fly

Alle Zeitangaben in WEZ +2. Es ist jetzt 05:22 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.