Ticket #16337: msize.yab

File msize.yab, 752 bytes (added by bbjimmy, 4 years ago)

yab script using bitmap

Line 
1#!yab
2
3doc Place a description of your
4doc program here.
5doc
6doc Author, date, license
7
8
9
10args=peek("argument")
11if args<>1 usage()
12arg$=peek$("argument")
13Bitmap$="temp"
14ErrCode = BITMAP IMAGE arg$, Bitmap$
15ht=(BITMAP GET Bitmap$, "height")+1
16wd= (BITMAP GET Bitmap$, "width")+1
17print "ht "+str$(ht)+" wd "+str$(wd)
18//ATTRIBUTE SET "Int", "Media:Width", str$(wd), arg$
19//ATTRIBUTE SET "Int", "Media:Height", str$(ht), arg$
20system("addattr -t int32 Media:Width "+str$(wd)+" "+arg$)
21system("addattr -t int32 Media:Height "+str$(ht)+" "+arg$)
22
23end
24
25sub usage()
26
27print "msize by Jim Saxton"
28print "Usage"
29
30print "msize filename"
31print "This sets the media width and media height attributes"
32print "and prints ht media height, wd media width"
33exit
34end sub
35