|
I am thinking that pages containing images would load faster, if the images were scaled to a maximum 640x853 dimensions. I have a patch that does this. If you spot any problems please point them out. Additionally, I would like the image appearing in the question or answer, to be a link to the original image. How do I achieve this? Where is it img= ... code rendered so that I can add an href?
|
|
I had a similar question. So I added FancyBox support to the images. This allows an image to appear as a small inline image in the flow of the page. When you click on the image, it expands to a full size in a pop up dialog. Fancybox can be found here: fancybox.net Rather than modify the writer.py file, I used JQuery to find all of the image links in the questions/answers and replaced everything on the fly at the browser. This has the added advantage of working on javascript disabled browsers. In those cases, the images just appear full size inline. Here are the changes I wrote to add FancyBox at the browser:
Thank you for mentioning fancybox. I will look into it. If I understand correctly, the page loads the full image but it displays it in a smaller dimension. So, the download occurs. Right?
(09 Aug '11, 19:18)
mgiann
1
That is correct. The original image is downloaded and scaled by the browser. The site places a limit on the size of the file that can be uploaded. I've set that limit to prevent a huge image from being loaded, but still allow manageable ones. If you allow enormous images, that might be a problem. Also remember that the image is cached by the browser, so you only take the hit once per user.
(09 Aug '11, 19:29)
JonathanB
|
I added also some javascript in my original solution which allows to click on the image and view the original. This makes it more complete.
added in the <head> page of the administration panel:
I am thinking of submitting the question as a feature request. Are there any others interested on this feature?