#GIF 89a comment blocks??
5 messages in this thread
Does anyone know of a utility that can extract comment blocks from a
GIF 89a file? How hard would it be to write a C program to do it if
there isn't one already?
Thanks in advance for any replies.
— Peter.
There are several comment related utilities, for MS-DOS, in lib 14 of
the Graphics Support forum. AC.ZIP, VC.ZIP and XC.ZIP. AC adds them,
VC views them and XC extracts them to a text file. Might be what you
seek?
Thanks Tom. Those sound like a possibility since I have access to MS-DOS
hardware. But, is there anything like those porgrams for an Amiga???
–Peter.
/* Test – read gif comment block */
/* Std. startup. */
if ~show('l','rexxsupport.library') then call
addlib('rexxsupport.library',0,-30,0) if ~show('l','rexxarplib.library')
then call addlib('rexxarplib.library',0,-30,0) options results
file = getfile(0,0,'dl:')
if file = '' then exit
call open(inf,file)
wrk = lastpos('/',file)
if wrk = 0 then wrk = lastpos(':',file)
wrkfil = right(file,length(file)-wrk)
wrkfile = left(wrkfil,length(wrkfil)-4)
chunk = readch(inf,6)
if translate(chunk) ~= 'GIF89A' then do
say 'Not a valid GIF89a file'
exit
end
call open(out,'ram:testfile','w')
do until eof(inf)
y = readln(inf)
if eof(inf) then leave
nr = pos('0021FEFF'x,y)
if nr >0 then do
z = right(y,length(y)-(nr+2))
call writeln(out, z)
leave
end
end
do until eof(inf)
y = readln(inf)
if eof(inf) then leave
if y = '0d'x then iterate
if pos('003b'x,y) >0 then leave
if pos('FFFF'x,y) >0 then leave
if right(y,1) = '0d'x then y = left(y,length(y)-1)
call writeln(out, y)
end
call close(inf)
call close(out)
if nr <1 then do
say 'No Comment Block'
exit
end
call open(inf,'ram:testfile')
call open(out,'ram:'||wrkfile||'.CMT','w')
do until eof(inf)
y = readch(inf,1)
if eof(inf) then leave
if c2d(y) > 128 then iterate
if y = 'FF'x then iterate
if y = '07'x then iterate
if y = '0d'x then iterate
call writech(out,y)
end
call close(inf)
call close(out)
exit
Wow Bill! Much more than I expected. I hope you didn't just whip this up for
me<g>.
Many, many thanks!
— Peter.