Jump to content

sturbitt

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sturbitt's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for the help! I was looking at possibly using the database some how but I am not very good with DBs (not my thing). The $image is the thumb nail I have already generated the picture. All I am tring to do is save that file to disk so that the next time I need it I don't need to regenerate the picture (hopefully speeding up my web site). So My plan was to create a "_thumbs" directory in the root of the web site and save all my thumbnails into that in the same directory structure as the rest of the web site (to avoid duplication). I can do this, but I also offer the ability to view the picture in different sizes (small medium and large) for this I just reuse the thumbnail generation scripts but do it bigger. So what I would like to do is put the size of the image stored in the file name or directory structure: i.e: _thumbs\150\testdir\test.jpg or _thumbs\testdir\150test.jpg But every time I mention the $imagesize variable anywhere the whole thing stops working - it works fine without it! I will try and digest the DB solution with the upload script but its getting frustrating as to why my script isn't working. Thanks again!
  2. Thanks for the suggestion but its still not working. My main problem is I don't get error message as the script is dealling with images and all I get is no picture displayed. I am going to try and build another script with just making directories bit in it and see if I can get an error message. Any other suggestions in the mean time? Thanks again for your help.
  3. I am trying to save my thumbnails but I need to save them with the size that they are in the path of the directory or in the file name, however everytime I insert the interger into the string my script stops working. I have tried to convert the int to string with strval() but it didnt work either. Here is one of the attempts I have made: $trgdir = "_thumbs\\$directory"; if(!(file_exists("$trgdir"))) { mkdir("$trgdir"); } $sizeandfile = strval($thumbsize); $sizeandfile = "$sizeandfile$image"; $trgfile = "$trgdir\\$image"; if(!(file_exists("$trgfile"))) { imagejpeg($thumb, $trgfile); } I have tried loads of thing like concating strings and thing but to no avail. Cheers Steven
  4. I have just done some redesigning and work out a way of getting the info I need into the picture.php script. Cheers Steven
  5. I have built a web site to display pictures in a directory structure (with the help of this forum). In the past I just called a php script (picture.php) from a HTML link to calculate and display the thumbnails i.e.: echo "<TD> <A HREF=\"picture.php?image=$passeddirectory/$file&size=1024\"> <img src=\"picture.php?image=$directory/$file&size=150\" alt=\"$file\" /> <A/>"; However I am to trying and speed up my web site I would like to store the resulting thumbnail. So how do I run my script and capture the resulting image? i.e.: $thumb = "picture.php?image=$passeddirectory/$file&size=150"; I know this is wrong but can it be done? Thanks again for your help! Cheers Steven
  6. I have generated a web site which generates and displays thumbnails using createimagefromjpeg. This all works fine and I am happy with the result but I would also like to do the same from my movies. All of my movies are mpgs so does createimagefrommpeg exsist or can this be done through som other way? My picture web site can bee seen at [a href=\"http://turbitt.is-a-geek.com/pics\" target=\"_blank\"]http://turbitt.is-a-geek.com/pics[/a] Cheers
  7. Thanks for the tips - my coding needs a lot of work as yet. Howerver I still get a lot of gobbledy-gook out and / or header information warnings: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] Warning: Cannot modify header information - headers already sent by (output started at c:\program files\easyphp1-8\www\tutorial\picture\index.php:2) in c:\program files\easyphp1-8\www\tutorial\picture\index.php on line 5 ÿØÿàJFIFÿþ>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality ÿÛC    $.' ",#(7),01444'9=82<.342ÿÛC  2!!22222222222222222222222222222222222222222222222222ÿÀ––"ÿÄ ÿĵ}!1......... [/quote] Any ideas? I am tearing my hair out - and I didn't have much to start with! ;-)
  8. I am trying to teach myself PHP and I have run through a few tutorial and set myself a project. I am now stuck. I am trying to get PHP to generate thumnails for all my pictures, which are all in directories, and displaythem onto an HTML web page. I am running into a lot of issues with headers. I am sure this must be a fairly simple thing to do. All my pictures are jpgs and are in the directory the PHP is running in. Most of my tries have been cut and pasted examples. Any ideas or points in the right direction would be much Apprenticed. Here is one of my attempts: <?php ob_start(); ?> <html> <body> <br>Start of HTML.<br> <?php // Content type header('Content-type: image/jpeg'); //echo "<br>$image<br>"; //$filename = $image; $filename = "test.jpg"; $percent = 0.5; // Get new sizes list($width, $height) = getimagesize($filename); $newwidth = 150; $newheight = 150; // Load $thumb = imagecreatetruecolor($newwidth, $newheight); $filename = imagecreatefromjpeg($filename); // Resize imagecopyresized($thumb, $filename, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); // Output imagejpeg($thumb); //return $thumb; ob_end_flush(); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.