Home All Groups Group Topic Archive Search About

Read the width and height of an image



Author
6 Apr 2006 2:03 PM
Stilts
Hi

Working in asp (not asp.net) I need to read the width and height of an
image before they are displayed on the page.

I have a folder full of images that are dynamically put on a page and I
need to read if they are landscape or protrait.

Any help much appreciated.

Show quote
:)

Author
6 Apr 2006 2:14 PM
Slim
I don't thing you can server side.

you may need to do so client side



Show quote
"Stilts" <stil***@hotmail.co.uk> wrote in message
news:1144332226.394349.79620@v46g2000cwv.googlegroups.com...
> Hi
>
> Working in asp (not asp.net) I need to read the width and height of an
> image before they are displayed on the page.
>
> I have a folder full of images that are dynamically put on a page and I
> need to read if they are landscape or protrait.
>
> Any help much appreciated.
>
> :)
>
Author
6 Apr 2006 2:37 PM
Stilts
There must be a way for the web code to read the image in a folder??

Help!
Author
6 Apr 2006 2:50 PM
Evertjan.
Stilts wrote on 06 apr 2006 in microsoft.public.inetserver.asp.general:

> There must be a way for the web code to read the image in a folder??

Please quote what you are replying to. If you want to post a followup via
groups.google.com, don't use the "Reply" link at the bottom of the article.
Click on "show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
<http://www.safalra.com/special/googlegroupsreply/>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Author
6 Apr 2006 2:49 PM
Evertjan.
Slim wrote on 06 apr 2006 in microsoft.public.inetserver.asp.general:
> "Stilts" <stil***@hotmail.co.uk> wrote in message
> news:1144332226.394349.79620@v46g2000cwv.googlegroups.com...
>> Working in asp (not asp.net) I need to read the width and height of an
>> image before they are displayed on the page.
>>
>> I have a folder full of images that are dynamically put on a page and I
>> need to read if they are landscape or protrait.

[please do not toppost on usenet]

> I don't thing you can server side.
>
> you may need to do so client side

PHP can (sorry OT):

getimagesize()

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Author
6 Apr 2006 3:12 PM
Justin Piper
On Thu, 06 Apr 2006 09:03:46 -0500, Stilts <stil***@hotmail.co.uk> wrote:
> Working in asp (not asp.net) I need to read the width and height of an
> image before they are displayed on the page.

ImageMagick comes with a COM object that can do this.

    ' = Function: Dimensions =
    ' Use an instance of the ImageMagickObject to determine the width and
    ' height of an image.
    '
    ' Arguments:
    '   im  - An instance of the ImageMagickObject.
    '   src - The name of the source file.
    '
    ' Returns:
    '   An array containing the width and height as elements 0 and 1,
    '   respectively.
    Function Dimensions(im, src)
       Dim msgs
       msgs = im.Identify("-format", "%w,%h", src)
       Dimensions = Split(msgs)
    End Function

You can find it at http://www.imagemagick.org/.

--
Justin Piper
Bizco Technologies
http://www.bizco.com/
Author
6 Apr 2006 3:42 PM
Stilts
Justin Piper wrote:
Show quote
> On Thu, 06 Apr 2006 09:03:46 -0500, Stilts <stil***@hotmail.co.uk> wrote:
> > Working in asp (not asp.net) I need to read the width and height of an
> > image before they are displayed on the page.
>
> ImageMagick comes with a COM object that can do this.
>
>     ' = Function: Dimensions =
>     ' Use an instance of the ImageMagickObject to determine the width and
>     ' height of an image.
>     '
>     ' Arguments:
>     '   im  - An instance of the ImageMagickObject.
>     '   src - The name of the source file.
>     '
>     ' Returns:
>     '   An array containing the width and height as elements 0 and 1,
>     '   respectively.
>     Function Dimensions(im, src)
>        Dim msgs
>        msgs = im.Identify("-format", "%w,%h", src)
>        Dimensions = Split(msgs)
>     End Function
>
> You can find it at http://www.imagemagick.org/.
>
> --
> Justin Piper
> Bizco Technologies
> http://www.bizco.com/

Sorry but I'm not sure about above.  I gather there's no standard asp
version like phps getimagesize()???
Author
6 Apr 2006 4:00 PM
Justin Piper
On Thu, 06 Apr 2006 10:42:06 -0500, Stilts <stil***@hotmail.co.uk> wrote:

>
> Justin Piper wrote:
>> On Thu, 06 Apr 2006 09:03:46 -0500, Stilts <stil***@hotmail.co.uk> 
>> wrote:
>> > Working in asp (not asp.net) I need to read the width and height of an
>> > image before they are displayed on the page.
>>
>> ImageMagick comes with a COM object that can do this.
>
> Sorry but I'm not sure about above.  I gather there's no standard asp
> version like phps getimagesize()???
>

Nothing I'm aware of, sorry.

--
Justin Piper
Bizco Technologies
http://www.bizco.com/
Author
6 Apr 2006 3:58 PM
Kyle Peterson
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=4&txtCodeId=6629


Show quote
"Stilts" <stil***@hotmail.co.uk> wrote in message
news:1144332226.394349.79620@v46g2000cwv.googlegroups.com...
> Hi
>
> Working in asp (not asp.net) I need to read the width and height of an
> image before they are displayed on the page.
>
> I have a folder full of images that are dynamically put on a page and I
> need to read if they are landscape or protrait.
>
> Any help much appreciated.
>
> :)
>
Author
7 Apr 2006 11:18 AM
Stilts
Thanks Kyle, much appreciated :)

AddThis Social Bookmark Button