Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Unable to view generated thumbnail images.

Unable to view generated thumbnail images.

Scheduled Pinned Locked Moved Web Development
graphicssysadmintoolshelpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JimBob SquarePants
    wrote on last edited by
    #1

    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

    N M 2 Replies Last reply
    0
    • J JimBob SquarePants

      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

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      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

      J 1 Reply Last reply
      0
      • J JimBob SquarePants

        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

        M Offline
        M Offline
        molesworth
        wrote on last edited by
        #3

        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...

        J 1 Reply Last reply
        0
        • N Not Active

          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

          J Offline
          J Offline
          JimBob SquarePants
          wrote on last edited by
          #4

          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 *******************************************************************

          1 Reply Last reply
          0
          • M molesworth

            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...

            J Offline
            J Offline
            JimBob SquarePants
            wrote on last edited by
            #5

            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 *******************************************************************

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups