M
Mimic
Let me start by saying, I do NOT claim to be an expert in PHP or Image
Manipulation. And I scarcely touch JS. I enjoy using PHP and the like,
but am by no means an authority on the language.
The following describes features, limitations and conclusions on my
liquid image method. The test image isnt of high quality, but you
shouldnt have any problems with others. The files can be found here:
Code : http://alt2600.go.ro/
Test IMG: http://alt2600.go.ro/sara.png
[and no, Im not romanian
]
Liquid Images [dev Mimic]
-------------------------
In this version I have elimiated the reliance on cookies, instead using
a POST variable with a redirect, supressing any initial errors, the user
will have no idea this stage takes effect.
The user need not click 'refresh' or 'go' in order to resize the image.
As was the case in previous versions.
I have also added an image cache. This decreases server load, as if an
image of the required dimensions already exists, it is sent, rather than
redrawn. Hatters is drawn each time, which I believe everyone concluded
is very server intensive.
At the start of the image routine, theres a code block to delete all
cached images on the first of each month - this can be modified
appropriately. This will - obviously - conserve server space.
Another benefit over hatters code, is that mine is contained. Hatters
image routine is like spilling water on the floor, it fills the entire
page width not matter what. Mine is like pouring it into a glass - this
"glass"[image] can than be positioned anywhere and doesnt take up the
whole screen.
At the end I also destroy the image to free up server resources.
Something I dont believe was done in previous versions.
Limitations:
------------
-Requires JS to be enabled. Default setups shouldnt have a problem
with this. Use of the <noscript> tag can be included as an advisory.
-Its alot of code for one thing, if you have alot of images this will
*NOT* be suitable. Id say 3-5 max. Prolly best suited to title images.
Known Bugs:
-----------
- Firefox, when resized to very small dimensions, puts the refresh into
a loop, this isnt so much of a problem as the image matches the server
cache image so is not redrawn, further it should then be loaded from the
client cache. However, it is an annoyance. Any input on this would be
greatfully appreciated.
If you wish to test it, you'll have to create the directory
"image-cache", and replace any localhost entries as required.
Tested in Firefox,MSIE,NS and Opera on Apache under WinXPp and Linux
oh, and its all 100% Valid Code
In Conclusion:
--------------
Given the extent of the code required to utilise the resize, it really
isnt suitable for anything other than say a title image or if youre
hosting a site like hotornot where the primary content is a single image.
Unless Im making a nice css minimalist site with very few images, I wont
be using this.
--
Mimic
"I can speak to anyone in the world, I can get any information I want, I
can goto new zealand in 0.384 seconds, why would I want to go outside?"
ZGF0YWZsZXhAY2FubmFiaXNtYWlsLmNvbQ== ( www.hidemyemail.net )
"Without knowledge you have fear. With fear you create your own nightmares."
"He who controls Google, controls the world".
Manipulation. And I scarcely touch JS. I enjoy using PHP and the like,
but am by no means an authority on the language.
The following describes features, limitations and conclusions on my
liquid image method. The test image isnt of high quality, but you
shouldnt have any problems with others. The files can be found here:
Code : http://alt2600.go.ro/
Test IMG: http://alt2600.go.ro/sara.png
[and no, Im not romanian
Liquid Images [dev Mimic]
-------------------------
In this version I have elimiated the reliance on cookies, instead using
a POST variable with a redirect, supressing any initial errors, the user
will have no idea this stage takes effect.
The user need not click 'refresh' or 'go' in order to resize the image.
As was the case in previous versions.
I have also added an image cache. This decreases server load, as if an
image of the required dimensions already exists, it is sent, rather than
redrawn. Hatters is drawn each time, which I believe everyone concluded
is very server intensive.
At the start of the image routine, theres a code block to delete all
cached images on the first of each month - this can be modified
appropriately. This will - obviously - conserve server space.
Another benefit over hatters code, is that mine is contained. Hatters
image routine is like spilling water on the floor, it fills the entire
page width not matter what. Mine is like pouring it into a glass - this
"glass"[image] can than be positioned anywhere and doesnt take up the
whole screen.
At the end I also destroy the image to free up server resources.
Something I dont believe was done in previous versions.
Limitations:
------------
-Requires JS to be enabled. Default setups shouldnt have a problem
with this. Use of the <noscript> tag can be included as an advisory.
-Its alot of code for one thing, if you have alot of images this will
*NOT* be suitable. Id say 3-5 max. Prolly best suited to title images.
Known Bugs:
-----------
- Firefox, when resized to very small dimensions, puts the refresh into
a loop, this isnt so much of a problem as the image matches the server
cache image so is not redrawn, further it should then be loaded from the
client cache. However, it is an annoyance. Any input on this would be
greatfully appreciated.
If you wish to test it, you'll have to create the directory
"image-cache", and replace any localhost entries as required.
Tested in Firefox,MSIE,NS and Opera on Apache under WinXPp and Linux
oh, and its all 100% Valid Code
In Conclusion:
--------------
Given the extent of the code required to utilise the resize, it really
isnt suitable for anything other than say a title image or if youre
hosting a site like hotornot where the primary content is a single image.
Unless Im making a nice css minimalist site with very few images, I wont
be using this.
--
Mimic
"I can speak to anyone in the world, I can get any information I want, I
can goto new zealand in 0.384 seconds, why would I want to go outside?"
ZGF0YWZsZXhAY2FubmFiaXNtYWlsLmNvbQ== ( www.hidemyemail.net )
"Without knowledge you have fear. With fear you create your own nightmares."
"He who controls Google, controls the world".