On 25 Apr 00 at 9:04, Bernie wrote:

>>>How much code would it take to identify graphic file types and 
>>>then report an "error" code that the calling program (core.exe?) 
>>>would use to rename them correctly, and of course, call the 
>>>appropriate conversion program? Just some thoughts.
>>
>>The control would be something like this (it must be inside core.exe so that
>>we can use whatever program we want for converting/viewing images).
>>
>>void is_it_a_jpeg_or_a_gif(FILE *file)
>>{
>> char buf[4];
>>
>> fread(buf, 4, 1, file);
>>
>> if(strcmp(buf, "JFIF") == 0)
>>  it_is_a_jpeg();
>> else if(strcmp(buf, "GIF8") == 0)
>>  it_is_a_gif();
>> else
>>  we_dont_know_let_mime_cfg_handle_it();
>>}
>>
>>So the code wouldn't be that much (this is a very easy test that can be
>>fooled of course, but it shouldn't mix up GIFs and JPEGs - besides it should
>>only be used on <IMG> tags. Still the fault is on the server end (by whoever
>>put the files there from the begining). BTW: This code hasn't been tested...

Very impressive, Bernie. Thanks for your remarks. In the earlier post 
I was assuming this would be done by an external program, like JPEG 
conversions.

Regards,
Dale Mentzer

It's hard to make a comeback when you haven't been anywhere


    This mail written by a user of Arachne, the DOS Internet Client
                WWWWW World Wide Web Without Windows    
          http://home.arachne.cz Arachne DOS Browser Home Page        

Reply via email to