Microsoft Content Management Server - Check the dimension of the image...

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > February 2004 > Check the dimension of the image...





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Check the dimension of the image...
Stefano

2004-02-05, 3:43 am

Hi,

I need to check the dimension (width and height) of the
image inserted through a SingleImagePlaceholder, to allow
users to insert only images that respect my own height and
width criteria.

If it's impossible to check the dimension when the user
insert the image into placeholder, so I would like to show
a message when the placeholder render itself in
presentation mode when the image is too much large or too
much high.

Is there something that can help me in this task into CMS?

Thank you so much.

Bye
Stefano
Stefan [MSFT]

2004-02-05, 3:43 am

Hi Stefano,

this is not very easy to achieve.
You could implement a check in a workflow when saving to retrieve the object
and check the dimensions.
On the client side this is not possible.

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Stefano" <anonymous@discussions.microsoft.com> wrote in message
news:ae5901c3ec07$fe5fe710$a601280a@phx.gbl...
quote:

> Hi,
>
> I need to check the dimension (width and height) of the
> image inserted through a SingleImagePlaceholder, to allow
> users to insert only images that respect my own height and
> width criteria.
>
> If it's impossible to check the dimension when the user
> insert the image into placeholder, so I would like to show
> a message when the placeholder render itself in
> presentation mode when the image is too much large or too
> much high.
>
> Is there something that can help me in this task into CMS?
>
> Thank you so much.
>
> Bye
> Stefano




Stefano

2004-02-05, 7:36 pm

>Hi Stefano,

Hi Stefan

>this is not very easy to achieve.


I know! :-)

>You could implement a check in a workflow when saving to

retrieve the object
>and check the dimensions.


What object? I was thinking to instantiate a Bitmap
object, referencing to the file system cached version of
the image. But... is this too much expensive for the CPU
and RAM of the server?
I believe that depend of the size of the image.
Any ideas?
Thank you so much !

>On the client side this is not possible.


I know...

>Cheers,
>Stefan.


Bye,
Stefano
Stefan [MSFT]

2004-02-05, 8:35 pm

Hi Stephano,

you would have to read the content of the placeholder, extract the GUID from
the Url and do a search for the GUID using the searches object.
Then check if the received object is a Resource. If yes, cast to Resource
and open the Resource using OpenReadStream and load it into a image object.
Here you are able to read the size.
If the GUID is not the GUID of a Resource then this is a little bit more
complicated. In this case you are dealing with a local resource. the only
way to receive local resources are to use the HttpRequest class and issue an
GET request against the local server. Then take the http stream and change
check the dimensions here.

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Stefano" <anonymous@discussions.microsoft.com> wrote in message
news:ae3501c3ec90$e160d050$a101280a@phx.gbl...
>
> Hi Stefan
>
>
> I know! :-)
>
> retrieve the object
>
> What object? I was thinking to instantiate a Bitmap
> object, referencing to the file system cached version of
> the image. But... is this too much expensive for the CPU
> and RAM of the server?
> I believe that depend of the size of the image.
> Any ideas?
> Thank you so much !
>
>
> I know...
>
>
> Bye,
> Stefano



Adriano

2004-02-06, 12:38 am

Ciao Stefano,
if you figure out a good way of doing this, I'd really like to hear it
-- we have the same issue.
[color=blue]
> "Stefano" <anonymous@discussions.microsoft.com> wrote in message
> news:ae5901c3ec07$fe5fe710$a601280a@phx.gbl...
Stefano

2004-02-06, 3:40 am

Ciao Adriano,

(visto che sei italiano):
penso che adotter=F2 la tecnica suggerita da Stefan nel post=20
successivo.
So, stay tuned... vi far=F2 sapere.

Ciao!
Stefano

>-----Original Message-----
>Ciao Stefano,
>if you figure out a good way of doing this, I'd really=20

like to hear it
>-- we have the same issue.
>
in message[color=blue]
the[color=blue]
allow[color=blue]
height and[color=blue]
user[color=blue]
show[color=blue]
too[color=blue]
CMS?[color=blue]
>.
>

Stefano

2004-02-08, 9:35 pm

Hi Stefan,

what is the safe way to extract the GUID from the
ImagePlaceholder.Src property's value?

I'm noting that this value is something like:
"/NR/rdonlyres/46F523A8-4FEB-4F89-9A8D-
7D1E67D3502C/0/1.jpg"

in this case the Guid is: "46F523A8-4FEB-4F89-9A8D-
7D1E67D3502C"
(what does "/0/" stand for?)

Can I always refer to this pattern or are there exceptions
of it?

Thank you so much.
Bye

Stefano

>-----Original Message-----
>Hi Stephano,
>
>you would have to read the content of the placeholder,

extract the GUID from
>the Url and do a search for the GUID using the searches

object.
>Then check if the received object is a Resource. If yes,

cast to Resource
>and open the Resource using OpenReadStream and load it

into a image object.
>Here you are able to read the size.
>If the GUID is not the GUID of a Resource then this is a

little bit more
>complicated. In this case you are dealing with a local

resource. the only
>way to receive local resources are to use the HttpRequest

class and issue an
>GET request against the local server. Then take the http

stream and change
>check the dimensions here.
>
>Cheers,
>Stefan.
>
>--
>This posting is provided "AS IS" with no warranties, and

confers no rights.
>
>
>"Stefano" <anonymous@discussions.microsoft.com> wrote in

message
>news:ae3501c3ec90$e160d050$a101280a@phx.gbl...
to[color=blue]
>
>
>.
>

Stefan [MSFT]

2004-02-08, 10:35 pm

Xref: intern1.nntp.aus1.giganews.com microsoft.public.cmserver.general:29656

Hi Stefano,

the guid is as you indicated below.
The /0/ is just a number you can ignore.
You need to add braces around the GUID like "{"+extractedGuid +"}"

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Stefano" <anonymous@discussions.microsoft.com> wrote in message
news:d45301c3eef6$de1e7790$a501280a@phx.gbl...[color=blue]
> Hi Stefan,
>
> what is the safe way to extract the GUID from the
> ImagePlaceholder.Src property's value?
>
> I'm noting that this value is something like:
> "/NR/rdonlyres/46F523A8-4FEB-4F89-9A8D-
> 7D1E67D3502C/0/1.jpg"
>
> in this case the Guid is: "46F523A8-4FEB-4F89-9A8D-
> 7D1E67D3502C"
> (what does "/0/" stand for?)
>
> Can I always refer to this pattern or are there exceptions
> of it?
>
> Thank you so much.
> Bye
>
> Stefano
>
> extract the GUID from
> object.
> cast to Resource
> into a image object.
> little bit more
> resource. the only
> class and issue an
> stream and change
> confers no rights.
> message
> to


Stefano

2004-02-09, 12:35 am

>Hi Stefano,

Hi Stefan

>the guid is as you indicated below.
>The /0/ is just a number you can ignore.


OK !

>You need to add braces around the GUID

like "{"+extractedGuid +"}"

Yes, I know...

>Cheers,
>Stefan.


Thank you so much.
Bye!
Stefano
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com