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. General Programming
  3. C#
  4. Compression posted images files

Compression posted images files

Scheduled Pinned Locked Moved C#
databasehelptutorialquestion
3 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.
  • R Offline
    R Offline
    Regardt
    wrote on last edited by
    #1

    Hi I am uploading a file, using HTTPPostedFile. Uploads are going fine but i want to compress the posted file (a JPEG image actually) on the fly (i.e. before storing in the database). For example if the client computer has selected a JPEG image file of 1056 Kb, the file uploaded / saved file size is reduced to , say 200-300 kb. Can this be accomplished? Any help would be appreciated Africa is a though country --"Hello daar vir die Afrikaans sprekendes"--

    D 1 Reply Last reply
    0
    • R Regardt

      Hi I am uploading a file, using HTTPPostedFile. Uploads are going fine but i want to compress the posted file (a JPEG image actually) on the fly (i.e. before storing in the database). For example if the client computer has selected a JPEG image file of 1056 Kb, the file uploaded / saved file size is reduced to , say 200-300 kb. Can this be accomplished? Any help would be appreciated Africa is a though country --"Hello daar vir die Afrikaans sprekendes"--

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Since JPEG images are already compressed by their very nature, you won't get to compress them any more than MAYBE 1%. The only method you have is to reduce the actual image size, from say 1280x1024 down to 320x240 and store that. This is the only way your going to save space. Unfortunatly, you can't blow the picture back up to it original size without a severe penalty in image quality. RageInTheMachine9532

      D 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Since JPEG images are already compressed by their very nature, you won't get to compress them any more than MAYBE 1%. The only method you have is to reduce the actual image size, from say 1280x1024 down to 320x240 and store that. This is the only way your going to save space. Unfortunatly, you can't blow the picture back up to it original size without a severe penalty in image quality. RageInTheMachine9532

        D Offline
        D Offline
        Daniel Turini
        wrote on last edited by
        #3

        JPEG is a lossy compression algorithm: if he wants to lose some image quality, he can keep the image size and further reduce the file size, with a loss on the image size (a drop to 25% image quality produces a way better result than a shrink/expand to 25% size). I see dumb people

        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