So, you think you know your stuff when it comes to computers? Mini-challenge inside...

notfred

Lifer
Feb 12, 2001
38,241
4
0
I have a portion of a GIF image here. Partial image (right click, save as).

That's the first 256 bytes of a GIF image. I made it partial on purpose - I didn't want anyone cheating and just opening it in photoshop to get the answer. (BTW, it crashed photoshop when I tried it).

Anyway, your challenge is to find the width and height of the image, had the file been complete. You're not allowed to use image editors or viewers (assuming that there's one out there that will open a partial file like this) to find the answer. Y ou can use whatever other method you like, as long as you don't use someone else software that was specifically made for dealing w/ gif images.

This does not require any programming.

Come on, let's see if anyone can do it. I'm prepared to watch this thread drop right off the first page in OT with no replies, but I hope you can prove me wrong. At least one of you has to be able to do this. :p

I'd also like to see yur solution as to how you found the answer.
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: FreshPrince
Originally posted by: notfred
damn cheaters.

how would u do it?

If I told you how to do it, it wouldn't be much of a challenge, would it?

Anyway, the file fragment has been slightly modified, so that IE trick wont work anymore.

Also: I changed the size of the image, try and find the new size :)
 

Haircut

Platinum Member
Apr 23, 2000
2,248
0
0
Originally posted by: FreshPrince
Originally posted by: notfred
damn cheaters.

how would u do it?
You could open it up in a hex editor, look at the Gif89a specification to find out where the data is that says how big the image is supposed to be and get it from there.
I'm guessing that's what notfred was expecting from us.
 

Yomicron

Golden Member
Mar 5, 2002
1,735
1
81
Originally posted by: notfred
Originally posted by: Yomicron
500x300?


Tell me how you got that, and dont say "I opened it in [name of app here] and went to properties > size".
I opened a gif where I knew the dimentions in TextPad and looked at is as hex and then looked for where they appeared in the file.

the first line is
46 49 47 38 39 61 F4 01 2C 01 91 00 00 00 00
F4 01 is the length (written backwards) 01F4h = 500d
2C 01 is the width so, 012Ch = 300d

I still don't know if 500x300 is correct.
 

Haircut

Platinum Member
Apr 23, 2000
2,248
0
0
Originally posted by: Yomicron
Originally posted by: notfred
Originally posted by: Yomicron
500x300?


Tell me how you got that, and dont say "I opened it in [name of app here] and went to properties > size".
I opened a gif where I knew the dimentions in TextPad and looked at is as hex and then looked for where they appeared in the file.

the first line is
46 49 47 38 39 61 F4 01 2C 01 91 00 00 00 00
F4 01 is the length (written backwards) 01F4h = 500d
2C 01 is the width so, 012Ch = 300d

I still don't know if 500x300 is correct.
I got 500x300 too. According to the specification here it seems right.
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: Yomicron
Originally posted by: notfred
Originally posted by: Yomicron
500x300?


Tell me how you got that, and dont say "I opened it in [name of app here] and went to properties > size".
I opened a gif where I knew the dimentions in TextPad and looked at is as hex and then looked for where they appeared in the file.

the first line is
46 49 47 38 39 61 F4 01 2C 01 91 00 00 00 00
F4 01 is the length (written backwards) 01F4h = 500d
2C 01 is the width so, 012Ch = 300d

I still don't know if 500x300 is correct.

yes, it is correct, and you're the first geek on here worth his salt :)

Ok, Haircut is a lazy geek who could be worth his salt if he actually put some effort into it :p
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
I'd have answered but I was busy fixing a PBJ for lunch :)

One interesting fact about the GIF file format is that the color table / palette is stored uncompressed at the beginning of the file. This means that you can re-color the GIF without having to re-encode the LZW-compressed bitmap bits.

I used this to do web-based map generation from database fields without having to pay patent licensing fees to Unisys (aka "stealth patent scum"). Their patents only apply to compressing / decompressing so a program that just re-writes the color table doesn't fall under their evil sway.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
Originally posted by: XRdirtHead
Does anyone in this thread have a job? J/K
Actually if you can answer notfred's question you probably have a good job, or are a CS / CE student on track to get a good job. :D
 

MichaelD

Lifer
Jan 16, 2001
31,528
3
76
Originally posted by: Haircut
Originally posted by: FreshPrince
Originally posted by: notfred
damn cheaters.

how would u do it?
You could open it up in a hex editor, look at the Gif89a specification to find out where the data is that says how big the image is supposed to be and get it from there.
I'm guessing that's what notfred was expecting from us.

Good Lord, man, those words you use...sounds like some awful tropical flesh-eating disease! :Q

I right-click->open with Paint->change stuff->get happy.

Gif89a editor? Were there Gif1a thru Gif 88a editors? :confused:
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: MichaelD
Originally posted by: Haircut
Originally posted by: FreshPrince
Originally posted by: notfred
damn cheaters.

how would u do it?
You could open it up in a hex editor, look at the Gif89a specification to find out where the data is that says how big the image is supposed to be and get it from there.
I'm guessing that's what notfred was expecting from us.

Good Lord, man, those words you use...sounds like some awful tropical flesh-eating disease! :Q

I right-click->open with Paint->change stuff->get happy.

Gif89a editor? Were there Gif1a thru Gif 88a editors? :confused:

There's only 87a and 89a.
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
I would have answered had I seen this thread in time. It's not exactly a tough question, for developers especially...

 

RGN

Diamond Member
Feb 24, 2000
6,623
6
81
Originally posted by: notfred
Originally posted by: Yomicron
Originally posted by: notfred
Originally posted by: Yomicron
500x300?


Tell me how you got that, and dont say "I opened it in [name of app here] and went to properties > size".
I opened a gif where I knew the dimentions in TextPad and looked at is as hex and then looked for where they appeared in the file.

the first line is
46 49 47 38 39 61 F4 01 2C 01 91 00 00 00 00
F4 01 is the length (written backwards) 01F4h = 500d
2C 01 is the width so, 012Ch = 300d

I still don't know if 500x300 is correct.

yes, it is correct, and you're the first geek on here worth his salt :)

Ok, Haircut is a lazy geek who could be worth his salt if he actually put some effort into it :p

I would have done that, but I was eating... :(