Thread: how to get an image from a website

  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    2

    how to get an image from a website

    Ok, im still fairly new to internet programming. I was wondering, what would be the best way to grab an image from a website. Ive tried using a get, but when I get the response and take and try to use the body from the response, well... Im not doing it right, I know that much. It is distorted though at least its still recognized as a jpg file. Anyways, any help would be great. I just don't know of another good alternative, but like I said im still new to c++ internet programming.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    http://cboard.cprogramming.com/showthread.php?t=92908
    Different file type, but the method is the same.

    Did you open the output file in binary mode?
    If you didn't, windows will likely perform end of line translation, inserting a byte here or there, thus messing up the result.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Aug 2007
    Posts
    2
    OMG, i can't believe i forgot about binary... I shoulda know that and done that in the first place, and that fixed it... lol. Thanks so much!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem reading tiff image files?
    By compz in forum C++ Programming
    Replies: 9
    Last Post: 10-30-2009, 04:17 AM
  2. Replies: 1
    Last Post: 05-27-2009, 12:46 PM
  3. get bitmap from image in website.
    By sgh in forum C# Programming
    Replies: 3
    Last Post: 03-23-2009, 09:34 PM
  4. Simple Image Processing
    By ejohns85 in forum C++ Programming
    Replies: 4
    Last Post: 03-19-2009, 12:10 PM
  5. Replies: 4
    Last Post: 03-02-2003, 09:12 AM