Unable to view generated thumbnail images.
-
Hi Folks, I've recently experienced a major problem with a website I recently uploaded. The problem is this...... I implemented a pretty standard thumbnail generation utility for uploaded images which works fine when tested on my local machine and also when I browse the website online from my local machine. It doesn't work when I browse from other machines and also any thumbnails generated on the server when browsed from another machine do not show up on my machine! I'm at a loss to explain this. Surely the code should be universal since it is processed by the server, not the local machine? The only thing I can think of is that somehow the browser communicates with the server in a specific way based upon the installed framework that is on the browsing machine causing the server to run the code in a particular way. This goes against my understanding of the browser server relationship though. My code is the following <code> ''' <summary> ''' Resizes images to the specified size. ''' </summary> ''' <param name="fileStream">The file stream.</param> ''' <param name="fileName">Name of the file.</param> ''' <param name="finalPath">Where to save the resized image</param> ''' <param name="maxWidth">Maximum Width</param> ''' <param name="maxHeight">Maximum Height</param> Public Shared Sub ResizeAndSave(ByVal fileStream As IO.FileStream, ByVal fileName As String, ByVal finalPath As String, ByVal maxWidth As Integer, ByVal maxHeight As Integer) Using originalBMP As New System.Drawing.Bitmap(fileStream) ' Calculate the new image dimensions Dim width As Integer = originalBMP.Width 'actual width Dim height As Integer = originalBMP.Height 'actual height &nb
-
Hi Folks, I've recently experienced a major problem with a website I recently uploaded. The problem is this...... I implemented a pretty standard thumbnail generation utility for uploaded images which works fine when tested on my local machine and also when I browse the website online from my local machine. It doesn't work when I browse from other machines and also any thumbnails generated on the server when browsed from another machine do not show up on my machine! I'm at a loss to explain this. Surely the code should be universal since it is processed by the server, not the local machine? The only thing I can think of is that somehow the browser communicates with the server in a specific way based upon the installed framework that is on the browsing machine causing the server to run the code in a particular way. This goes against my understanding of the browser server relationship though. My code is the following <code> ''' <summary> ''' Resizes images to the specified size. ''' </summary> ''' <param name="fileStream">The file stream.</param> ''' <param name="fileName">Name of the file.</param> ''' <param name="finalPath">Where to save the resized image</param> ''' <param name="maxWidth">Maximum Width</param> ''' <param name="maxHeight">Maximum Height</param> Public Shared Sub ResizeAndSave(ByVal fileStream As IO.FileStream, ByVal fileName As String, ByVal finalPath As String, ByVal maxWidth As Integer, ByVal maxHeight As Integer) Using originalBMP As New System.Drawing.Bitmap(fileStream) ' Calculate the new image dimensions Dim width As Integer = originalBMP.Width 'actual width Dim height As Integer = originalBMP.Height 'actual height &nb
Have you checked the compatibility mode settings on the browsers? I highly doubt that it is a bug in the framework Also, you may want to review the How to get answers post at the top of this forum. "Cracking up" is not an appropriate or descriptive subject line.
only two letters away from being an asset
-
Hi Folks, I've recently experienced a major problem with a website I recently uploaded. The problem is this...... I implemented a pretty standard thumbnail generation utility for uploaded images which works fine when tested on my local machine and also when I browse the website online from my local machine. It doesn't work when I browse from other machines and also any thumbnails generated on the server when browsed from another machine do not show up on my machine! I'm at a loss to explain this. Surely the code should be universal since it is processed by the server, not the local machine? The only thing I can think of is that somehow the browser communicates with the server in a specific way based upon the installed framework that is on the browsing machine causing the server to run the code in a particular way. This goes against my understanding of the browser server relationship though. My code is the following <code> ''' <summary> ''' Resizes images to the specified size. ''' </summary> ''' <param name="fileStream">The file stream.</param> ''' <param name="fileName">Name of the file.</param> ''' <param name="finalPath">Where to save the resized image</param> ''' <param name="maxWidth">Maximum Width</param> ''' <param name="maxHeight">Maximum Height</param> Public Shared Sub ResizeAndSave(ByVal fileStream As IO.FileStream, ByVal fileName As String, ByVal finalPath As String, ByVal maxWidth As Integer, ByVal maxHeight As Integer) Using originalBMP As New System.Drawing.Bitmap(fileStream) ' Calculate the new image dimensions Dim width As Integer = originalBMP.Width 'actual width Dim height As Integer = originalBMP.Height 'actual height &nb
Without going through all the code, the fact it works on your machine but not others suggests a couple of possible causes. First, you may have something pointing to a local file, rather than a server version. Since the file exists on your machine, it will work, but not on others. Try renaming the folders you created the original web site in, and see if it still works. A second possibility is that your thumbnail generation isn't working quite correctly, but having tested it on your mahine, you now have the required thumbnails in your cache, so they load OK. Try clearing your browser cache and trying again. As mentioned above, it's unlikely to be a framework problem, so I'd view that as a last resort after checking more mundane causes.
There are three kinds of people in the world - those who can count and those who can't...
-
Have you checked the compatibility mode settings on the browsers? I highly doubt that it is a bug in the framework Also, you may want to review the How to get answers post at the top of this forum. "Cracking up" is not an appropriate or descriptive subject line.
only two letters away from being an asset
Changed. Good point. It's been a long night and my brain's not what it should be. :zzz: I'm not saying that there's a bug in the framework. just that maybe somethings got corrupted on my computer. Even that's a shot in the dark.
JimBob SquarePants ******************************************************************* "He took everything personally, including our royalties!" David St.Hubbins, Spinal Tap about Ian Faith, their ex-manager *******************************************************************
-
Without going through all the code, the fact it works on your machine but not others suggests a couple of possible causes. First, you may have something pointing to a local file, rather than a server version. Since the file exists on your machine, it will work, but not on others. Try renaming the folders you created the original web site in, and see if it still works. A second possibility is that your thumbnail generation isn't working quite correctly, but having tested it on your mahine, you now have the required thumbnails in your cache, so they load OK. Try clearing your browser cache and trying again. As mentioned above, it's unlikely to be a framework problem, so I'd view that as a last resort after checking more mundane causes.
There are three kinds of people in the world - those who can count and those who can't...
Well..... A wee bit of a kip and a coffee later the answer was staring me in the face. There was a bug in the thumbnail code. I wasn't passing the temporary variable Tempwidth down to MaxWidth so filenames weren't matching saved records. I was also assigning the filepath for the images a static value rather than returning a dynamic value generated by landscape or portrait images. I turned it into a function and returned the value back and that fixed everything. Thanks to you both for your comments. It just takes a few sensible calm words to fix most problems. Cheers!
JimBob SquarePants ******************************************************************* "He took everything personally, including our royalties!" David St.Hubbins, Spinal Tap about Ian Faith, their ex-manager *******************************************************************