0
votes

Image Thumbnails and Etc.

Connection to database for the filename and details The table contains all the real file information. Mimetype, extensions and etc.

The physical images are located on a hdd in a folder path and are renamed as follow: s:\onlinemedia\files\1\2241.dat

[Type pjpeg] [Mime image/jpeg]

I can get all of that information however, when I set header to image/jpg I get the output of my string to the path.

s:\onlinemedia\files\1\2241.dat

$fileid = $passcode = '';
$fileid     = (isset($_GET['fileid']) ? $_GET['fileid'] : '');
$passcode   = (isset($_GET['passcode']) ? $_GET['passcode'] :'');
$filename = $frw->source->img($fileid,$passcode);
$thumb = PhpThumbFactory::create($filename);
$thumb->adaptiveResize(16,16);
$thumb->save($filename);
$thumb->show($filename);

What is really happening here?

1
You are going to need to show some code to get any useful answers.GWW
Yeah, we need the code that retrieves and outputs the file.Phoenix
Which and what code would you like the object collection, the method calls or page generation?user384929
my return data is current as follows: ÿØÿà�JFIF������ÿþ�/~Ï:/Ákúç‡ô[_èzo‹ ‹[yµû¯„ö~;ÒµŸøjçRµuõ¶âojW>µIk�xaå6M1oý·¿eOÙSà÷Ãm?R›DðOƒ4Ý6OÍá{Ë/øN¸ñeòøÇK¸½¹}?ÁZjxºõô}%á†ù ¶±ˆiMw&ª××}¬tŸ°Ÿuü6Ѿ<êÔ9Õ>!érN4‰Šáÿ�èÚÄ·6~šÈK=߈u¹Òe¹µ¿)ok%­º#È"¸K¯×¿Š_²lÿ�¾üKý¤¾/êG‡~ü#ÒžÏÅž>¿ÐSPÕôßÍsacâÍ/IÑôØ5]~/é×í{«FnåÄ›k3}¶Ñ?/£ÂqÌèÔÌr|âXl.çÂÓN5)ÍF*<“Vsv¿*wQNVI·wâÜ^I*Fk•¼N/J?SÅ]rKXó¹¥g¯µü‘ÿÙuser384929
looks like the headers are wronguser557846

1 Answers

0
votes

One thing I see in the posted code is this:

$thumb = PhpThumbFactory::create($filename);
$thumb->adaptiveResize(16,16);
$thumb->save($filename);
$thumb->show($filename);

When doing $thumb-save(); you need to pass the path to a new file to save it as. How you have it now will overwrite the original if you actually want to do that. Also, $thumb->show(); shouldn't need a parameter, it goes off the path parameter you used to create the object to begin with. I'm also not sure if you need to mess with the headers using PhpThumbFactory, as the show() method handles that I think.