HTML Text and Images

Andre Garzia andre at andregarzia.com
Tue Oct 5 15:23:14 EDT 2010


On Tue, Oct 5, 2010 at 3:15 PM, Ray Horsley <ray at linkit.com> wrote:

> Many thanks to Andre Garzia for help on this.  I'm still faced with some
> [possibly new] issues regarding setting the htmlText of a fld.  What I need
> is the height and width of images inside the htmlText.  Ideally I'd like to
> manipulate height and width.  I'm not downloading any images as files and
> I'm not using the binFile format so I don't believe they're residing
> anywhere on my local disk.
>
> Here's a typical span tag as an example:
>
> <span><img
> src="
> http://linkit.com/Schools/ETS%20Items/ETS%20Item%20Bank/ETS10Q1/01%20Fu
>
> ll%20Bank/04%20ELA%20QTI%20with%20GUIDs/Grade%20KLanguage%20Arts-95/images/3
> 8228.jpg"</span>
>
> Set the htmlText of any field to this string and you get a pretty little
> bird, but how tall and how wide is that bird?
>

Ray,

I think you're on the verge of using the wrong tool for the job. I think
your needs might be better served by RevBrowser than the HTMLText property
of the fields.

First of all, that span tag will be worthless in the htmltext, it will just
be ignored. Other thing is that HTMLText is not HTML and thus does not
possess the necessary stuff under the hood to make things like image
manipulation or introspection possible. I don't think you can check how wide
or how tall an image is inside a field if the imagesource is set to a remote
location.

If you'd use a revBrowser window, it might be possible to check that data
with javascript.

If you just use the HTMLText thing, I don't think it is possible but I am
not an expert, someone here might know better. I think you might need to:

  *  Rethink if HTMLText is what you should be using and maybe consider
moving to a better hypertext container such as revbrowser (which is not a
field and thus not really editable)
  *  If you stay with HTMLText, then, you might need an auxiliary routine to
parse the HTMLText property to pick all the images from the remote location,
download them, manipulate them as needed and then use them in the HTMLText
thing.

Andre




>
> Thanks,
>
> Ray Horsley
> LinkIt! Software
>



-- 
http://www.andregarzia.com All We Do Is Code.



More information about the Use-livecode mailing list