473,738 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help with thumbnail creation - pulling an all-nighter

I'm having trouble with the functions for resizing a picture uploaded to my
server. Consider the following:

$jpeg = imagecreatefrom jpeg($filePath) ; //I know this works!

$oldX = imageSX($jpeg);
$oldY = imageSY($jpeg);
$thumbH = 100;
$thumbW = ($oldX / $oldY) * 100; //I know the dimensions are correct

$thumbnail = ImageCreateTrue Color($thumbW, $thumbH);
if(!ImageCopyRe sampled($thumbn ail, $jpeg, 0, 0, 0, 0, $thumbW, $thumbH,
$oldX, $oldY)) {
print 'Error message<br />';
return;
}
//No error is produced, so the system thinks the image copy worked.

imagejpeg($thum bnail, 'thumb.jpg');

I get an thumbnail image that is completely black. I did not get an error
from the copy, so the system thinks it works - but nothing was copied.

Can someone please give some help?

Jul 17 '05 #1
0 1401

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5194
by: Steve | last post by:
Hi, I have a nice little script that works well displaying images on my website. It's a script where if you clik a thumbnail image a pop up window opens that contains a larger version of the same image. What I would like to create is a link that can be clicked on to close the window that contains the larger image. This would make it easier for the users to close the window. I have posted the script that I use. Any help would be much...
8
5157
by: slim | last post by:
hi again all, i am still working on the website as mentioned in earlier threads and have hit another snag... http://awash.demon.co.uk/index.php http://awash.demon.co.uk/vd.css the php is pulling a name and placing it under the thumbnail (the text is
7
1174
by: Chris Perry | last post by:
How do you create a thumbnail constrained to a box, without distorting and but making where it doesn't fill the box transparent. I'm two thirds there : Size fitImageSize = this.GetScaledImageDimensions( myBitmap.Width, myBitmap.Height, intThumbWidth, intThumbHeight); Bitmap imgOutput = new Bitmap(myBitmap, fitImageSize.Width,
1
1717
by: David Lozzi | last post by:
Hello, I'm wondering whats the best method to use for displaying several photos' thumbnails. One method I know is to dynamically resize the photo at the time the page is loaded. What does this do to server/site performance? The other is to copy the photo at time of upload and create a thumbnail then, have two separate images, therefor when displaying its just pulling the actual image. What do you think??
16
4879
by: Mark | last post by:
Hello. I am attempting to use AppendChunk() to write binary data to a memo field in Access 2000. My initial call to AppendChunk() results in a data type conversion error. Any suggestions? Here is a VBA function which demonstrates the problem. Thanks -Mark
4
1571
by: Lunchtimemama | last post by:
I have a UI with a gallery of thumbnail image previews. The PictureBoxes are created and their Images are generated by a method which quickly retrieves the icon for the filetype. Worker threads then asynchronously retrieve and resize the full image previews and update the PictureBox's Images when the new images are ready. The way I have it set up now, the method which generates the filetype icons creates and starts the new worker Threads....
1
1535
by: Dooboise | last post by:
Hi. For my website, I'm trying to develop a JavaScript that makes a div appear. I have found several samples that toggle a div back and forth between visible and hidden, but what I need is a bit different. Here's the scoop: I have a series of thumbnail images. What I'd like to happen is that, when a user clicks, for example, Thumbnail Number 1, an associated div would appear (I've already written the CSS that locates the div). I'd like that div...
6
2276
by: MGM | last post by:
Alright, so here's my issue. I have a bunch of .dbf files, about 40 or so by summer's end, I'd say. These dbf files somewhat differ from each other as far as number of columns and data is concerned. I need to transfer all of these dbf files over to a SQL Server database so that I may write ASP pages for pulling statistics from them. My problem is, this needs to be done in as easy a manner as possible, because we'll be getting more and more...
1
3139
by: dodgeyb | last post by:
Hi there, Trying to allow client to upload image, thumbnail it, and save it into sql table image field. Code compiles & runs but image cannot be retrieved. any clues what I'm doing wrong pls ! Dim origImage As System.Drawing.Image = System.Drawing.Image.FromStream(FileUpload1.PostedFile.InputStream)
3
946
by: iswar | last post by:
Hi..friends Im new to asp.net.. im trying to create thumbnails from the images stored in database (sql server2000). and i want to view the image larger on click thumbnail as a pop-up.. please help me.......... im using asp.net2.0 (c#) thanks for the support..
0
8968
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8787
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9334
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9259
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6750
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6053
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4824
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3279
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.