version 1.119, 2001/06/27 12:55:39
|
version 1.120, 2001/06/29 10:47:11
|
Line 306 char *PicTypeToMIME (PicType contentType
|
Line 306 char *PicTypeToMIME (PicType contentType
|
ImageElement |
ImageElement |
Returns the element (image parameter) and URL (url parameter) of an |
Returns the element (image parameter) and URL (url parameter) of an |
image in a docImage document. The user must free the memory associated |
image in a docImage document. The user must free the memory associated |
with the url parameter if the function is succesful. |
with the url parameter if the function is succesful. |
|
If the url parameter is NULL, we won't initialize it. |
Returns TRUE if succesful, FALSE otherwise. |
Returns TRUE if succesful, FALSE otherwise. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
ThotBool ImageElement (Document doc, char **url, Element *image) |
ThotBool ImageElement (Document doc, char **url, Element *image) |
Line 328 ThotBool ImageElement (Document doc, cha
|
Line 329 ThotBool ImageElement (Document doc, cha
|
|
|
if (!imgEl) |
if (!imgEl) |
return FALSE; |
return FALSE; |
|
|
attr = TtaGetAttribute (imgEl, attrType); |
|
length = TtaGetTextAttributeLength (srcAttr) + 1; |
|
value = TtaGetMemory (length); |
|
TtaGiveTextAttributeValue (srcAttr, value, &length); |
|
|
|
*url = value; |
|
*image = imgEl; |
*image = imgEl; |
|
|
|
if (url) |
|
{ |
|
attr = TtaGetAttribute (imgEl, attrType); |
|
length = TtaGetTextAttributeLength (srcAttr) + 1; |
|
value = TtaGetMemory (length); |
|
TtaGiveTextAttributeValue (srcAttr, value, &length); |
|
*url = value; |
|
} |
return TRUE; |
return TRUE; |
} |
} |
|
|
Line 359 char *DocImageMimeType (Document doc)
|
Line 361 char *DocImageMimeType (Document doc)
|
if (!IsHTTPPath (DocumentURLs[doc])) |
if (!IsHTTPPath (DocumentURLs[doc])) |
{ |
{ |
/* it is a local image */ |
/* it is a local image */ |
if (ImageElement (doc, &url, &image)) |
if (ImageElement (doc, NULL, &image)) |
{ |
{ |
TtaFreeMemory (url); |
|
type = TtaGetPictureType (image); |
type = TtaGetPictureType (image); |
mime_type = PicTypeToMIME (type); |
mime_type = PicTypeToMIME (type); |
} |
} |