Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 09-16-2003, 07:44 AM   #1
arzach
Registered User
 
Join Date: Oct 2001
Location: _root.italy.brescia
Posts: 28
Question Thumbnails on the fly

is it possible to load a jpg that doesn't exist on the server?
i can show it in the browser using a script like this below, but how can i load it in flash??

PHP Code:
<?php 
//setup
$max_w 80;
$max_h 80;

//load image
$img=null;
$img=@imagecreatefromjpeg("test.jpg");
if (
$img) {
    
$w imagesx($img);
    
$h imagesy($img);
    
$scale min($max_w/$w$max_h/$h);
    if (
$scale 1) {
        
$new_w floor($scale*$w);
        
$new_h floor($scale*$h);
        
$tmp_img imagecreatetruecolor($new_w$new_h);
        
imagecopyresized($tmp_img$img0000,$new_w$new_h$w$h);
        
imagedestroy($img);
        
$img $tmp_img;
        
    }

} else {
    echo 
"errore";
}

header("Content-type: image/jpeg");
imagejpeg($img);
?>
arzach is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:00 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.