Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get image size without loading it
Message
 
To
04/10/2013 07:02:42
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Pictures and Image processing
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2003
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01584779
Message ID:
01584780
Views:
80
>I'm generating webpages with some images in them. The slow part is getting the image size, which I do by
>
>
>loImg=LoadPicture(lcFajl)
>lnWidth=Round(loImg.Width/26.458,0)
>lnHeight=Round(loImg.Height/26.458,0)
>
>
>The first line is the slow part. I seem to remember these attributes can be extracted, given the filename, by some feature of scripting.filesystemobject that I can't find now.
>
>I think I saw something like that in the last ten days or so, but me.memory.refresh() returns .f. - so, is there anyone with better memory?

Here what I found:
(It is VB but its easy to convert :-))
dim myImg, fs
Set fs= CreateObject("Scripting.FileSystemObject")
if not fs.fileExists(img) then exit sub
set myImg = loadpicture(img)
iWidth = round(myImg.width / 26.4583)
iheight = round(myImg.height / 26.4583)
set myImg = nothing
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform