Getting the width and height of gif files
This WebDNA talk-list message is from 2000
It keeps the original formatting.
numero = 30842
interpreted = N
texte = This one always bothered me, so I took a whack at it this morning.The following code should pull the width and height values from all the gif files it finds in the same directory that the template is in -- WITH the following exceptions:1) For all gifs 255 x 255 and under, there should be no problems.2) Any width or height value that's a multiple of 256 will be over-reported as 32 pixels larger (ie: 256 becomes 288, 512 = 544, 768 = 800, etc)3) Any width or height value falling between 8192 and 8448 will be grossly *under*-reported.Of course, there wouldn't be *any* problems if WebCat didn't clean null characters (remind me again why we're still saddled with this legacy because of PageMill? ; ) but still, if you can live with the limitations, I thought the code may be of some use until WebCat 4 comes along.What ever happened to the [includeRAW] (not [include file&raw=T]) that Grant had mentioned two years back?You'll need a hexadecimal to decimal conversion table to run this. One is available at:http://toastdesign.com/hexToDec.txt
| Filename | Width | Height | Image |
[listfiles /][showif [getchars start=1&end=4&from=end][filename][/getchars]=.gif][text]theFile=[include file=[filename]][/text][math show=f]loW=[convertchars db=hexToDec.txt][getchars start=7&end=7][theFile][/getchars][/convertchars][/math][math show=f]hiW=[convertchars db= hexToDec.txt][getchars start=8&end=8][theFile][/getchars][/convertchars][/math][math show=f]loH=[convertchars db= hexToDec.txt][getchars start=9&end=9][theFile][/getchars][/convertchars][/math][math show=f]hiH=[convertchars db= hexToDec.txt][getchars start=10&end=10][theFile][/getchars][/convertchars][/math][showif [hiW]!32][math show=f]width=[hiW]*256+[loW][/math][/showif][hideif [hiW]!32][math show=f]width=[loW][/math][/hideif][showif [hiH]!32][math show=f]height=[hiH]*256+[loH][/math][/showif][hideif [hiH]!32][math show=f]height=[loH][/math][/hideif]| [filename] | [width] | [height] |  |
[/showif][/listfiles]
Rob MarquardtDesigner/Resident WireheadToast Design800 Washington Avenue NorthMinneapolis MN 55401612.330.9863 v612.321.9424 fwww.toastdesign.com-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to
Associated Messages, from the most recent to the oldest:
| |
- Getting the width and height of gif files (Rob Marquardt 2000)
|
This one always bothered me, so I took a whack at it this morning.The following code should pull the width and height values from all the gif files it finds in the same directory that the template is in -- WITH the following exceptions:1) For all gifs 255 x 255 and under, there should be no problems.2) Any width or height value that's a multiple of 256 will be over-reported as 32 pixels larger (ie: 256 becomes 288, 512 = 544, 768 = 800, etc)3) Any width or height value falling between 8192 and 8448 will be grossly *under*-reported.Of course, there wouldn't be *any* problems if WebCat didn't clean null characters (remind me again why we're still saddled with this legacy because of PageMill? ; ) but still, if you can live with the limitations, I thought the code may be of some use until WebCat 4 comes along.What ever happened to the [includeRAW] (not [include file&raw=T]) that Grant had mentioned two years back?You'll need a hexadecimal to decimal conversion table to run this. One is available at:http://toastdesign.com/hexToDec.txt| Filename | Width | Height | Image |
[listfiles /][showif [getchars start=1&end=4&from=end][filename][/getchars]=.gif][text]theFile=[include file=[filename]][/text][math show=f]loW=[convertchars db=hexToDec.txt][getchars start=7&end=7][theFile][/getchars][/convertchars][/math][math show=f]hiW=[convertchars db= hexToDec.txt][getchars start=8&end=8][theFile][/getchars][/convertchars][/math][math show=f]loH=[convertchars db= hexToDec.txt][getchars start=9&end=9][theFile][/getchars][/convertchars][/math][math show=f]hiH=[convertchars db= hexToDec.txt][getchars start=10&end=10][theFile][/getchars][/convertchars][/math][showif [hiW]!32][math show=f]width=[hiW]*256+[loW][/math][/showif][hideif [hiW]!32][math show=f]width=[loW][/math][/hideif][showif [hiH]!32][math show=f]height=[hiH]*256+[loH][/math][/showif][hideif [hiH]!32][math show=f]height=[loH][/math][/hideif]| [filename] | [width] | [height] |  |
[/showif][/listfiles]
Rob MarquardtDesigner/Resident WireheadToast Design800 Washington Avenue NorthMinneapolis MN 55401612.330.9863 v612.321.9424 fwww.toastdesign.com-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to
Rob Marquardt
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
customer info (2001)
ups quickcost [repost] (1999)
This list needs a digest: rant, rave... (1997)
HomePage Caution (1997)
WebCatalog 3 NT License FS (2000)
Weird [blank] interpretation (1999)
DreamWeaver extension (2000)
[OT] HTML EMAIL program wanted (1999)
WC2b15 File Corruption (1997)
WebCat for Unix?? (1997)
[WebDNA] [sendmail] sending two emails (2012)
Resume Catalog ? (1997)
WebCatalog for guestbook ? (1997)
Summing fields (1997)
ShowNext for method=POST (1997)
[SEARCH] Context for SKU prices not working... (1998)
'RequiredField' Question (1998)
Search in 2 or more catalogs (1997)
WebCatalog Features (1997)
WebMerchant and Mac Auth Hub Help Please (1999)