On Tue, Nov 4, 2008 at 1:14 PM, alinome.net <[EMAIL PROTECTED]> wrote:
>
>> How about these lines instead:
>>
>> if (strpos($attrs, 'height=') === false && strpos($attrs, 'width=') ===
>> false) {
>> list($realwidth,$realheight) = getimagesize($fieldURL.$location);
>> $attr .= " width='$realwidth' height='$realheight'";
>> }
>>
>> It should solve the first problem plus help with performance as it
>> only runs the getimagesize function when needed. (No idea how fast
>> that function may be)...
>
> Good idea. Yes, it's simpler and faster. But we can make it even
> simpler:
>
> if (strpos($attrs, 'height=') === false && strpos($attrs, 'width=')
> === false) {
> $size = getimagesize($fieldURL.$location);
> $attr .= $size[3];
> }
>
> The fourth element of the array returned by getimagesize is the whole
> string (height="xxx" width="xxx"). I didn't use before because I
> wanted to substitute the missing dimensions separately.
Excellent. Just made the change...
> By the way, I've just seen a little detail in the upload function. In
> this line:
>
> $attr .= " $f='$v' ";
>
> the leader space could be removed:
>
> $attr .= "$f='$v' ";
>
> It creates unnecessary doble spaces between attributes; and there's a
> space before $attr in the final return.
>
> I think the same line exists in other functions that compile XHTML
> attrs.
I fixed it in this function (2x). Will try and remember to look for it
elsewhere. I did a quick search for $attr and found 130 instances!
Perhaps we can fix them as we find them...
Cheers,
Dan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/boltwire?hl=en
-~----------~----~----~----~------~----~------~--~---