Need to read width/height from graphics file with VBScript/ASP classic

后端 未结 2 970
野性不改
野性不改 2021-01-28 06:34

I need to read a graphics file and get the width/height in VBScript (ASP). I found a package called gfxSpex that seems to be what a lot of people use but the GIFs g

2条回答
  •  我在风中等你
    2021-01-28 07:18

    Yes, I'm not sure why the comment was deleted! Basically, it gave me a link to https://docs.microsoft.com/en-us/windows-hardware/drivers/image/wia-image-processing-filter. It's a lot more than I needed but good to know it's there. I just used:

    set oIMG = CreateObject("WIA.ImageFile")
    oIMG.loadFile(path)
    iHeight = oIMG.Height
    iWidth = oIMG.Width
    set oIMG = nothing
    

    It worked for gif, jpg, and png's. I didn't even need to register it.

提交回复
热议问题