Developer forum

Forum » Development » Gallery module: compression option

Gallery module: compression option

Maulik Kataria
Reply
Hi,

Is there any option to control the compression quality of the Images generated by gallery module? It seems that the jpg images generated are not good quality. If I replace the generated images by my original images, it still replaces them and generates new images. Is there a way to change the quality of compression?

Thanks.


Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer
That cannot be controlled. It is set to 75 which is pretty hard.

I've added it as a backlog item for DW 8 so it can be controlled on paragraph level.

You can use GetImage.aspx in the mean time on the original image - with that you can control compression.

Votes for this answer: 0
 
David Matheson
Reply

Hi,

Yes please, low compression was also a problem when selling the old image gallery module to customers.  Please set it as 100 % as default.

David

 
Maulik Kataria
Reply
Could you please tell me how to use GetImage.aspx? Where should I specify it?

Thank you very much for the reply.

 
David Matheson
Reply
Could you please tell me how to use GetImage.aspx? Where should I specify it?

Thank you very much for the reply.

Hi,  see my blog at http://www.grublestova.no/dynamicweb/general/imageglue.aspx for an explanation.  You will have to change the ParagraphImageCleanTag to the Gallery module tag that fetches the image.

Good luck

David
 
Nicolai Høeg Pedersen
Reply
And all solutions have a /Admin/Public/GetImage.aspx that you can enter into the browser. It will give you a set of options to choose from and generate a URL you can use for img src tag/attribute.
 
Maulik Kataria
Reply
Thanks Nicolai and David.

That was very useful. For now, I have just used <!--@Gallery.Image.Path--> which returns the original image. And if I need a post processed image I would be able to use GetImage.aspx with the original image.

However I am concerned that GetImage.aspx might slow down the page loading as it might convert the image every single time. Same for the gallery, it seems that for every page load it regenerate the resized images. Can I avoid this?

 
Nicolai Høeg Pedersen
Reply
Good concerns.

GetImage.aspx caches its output on disk - and it is only redone when the original changes or one of the parameters.

Gallery module redos the thumbnails when you are using the preview button from administration - it gives a URL with ?purge=true in the querystring parameters. And that makes a redo of the thumbnails.

If you just browse the page without purge=true, images are used without making new thumbnails.

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
Has caching in the Gallery module been changed recently? I recall reporting an issue where two galleries from two separate folders with files sharing the same name would overwrite each other's thumbnails. E.g. I could have /Gallery1/1.jpg and /Gallery2/1.jpg both resulting in a cached image called 1.jpg or something like that. If that's still the case, it might be a good idea to add that as a backlog item as well...

Imar

 
Nicolai Høeg Pedersen
Reply
Hi Imar

When publishing a folder, caching is placed in 2 subfolders called GalleryImages and GalleryThumbs - so no reusing of the same cache folder.

/Gallery1/1.jpg would be cached in /Gallery1/GalleryImages/1.jpg and /Gallery1/GalleryThumbs/1.jpg
and
/Gallery2/1.jpg would be cached in /Gallery2/GalleryImages/1.jpg and /Gallery2/GalleryThumbs/1.jpg

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Nicolai,

Yes, you're right. I looked up the issue and it's slight different. The problem occurs when using the same Gallery on multiple pages with different image dimensions. I could, for example, show a gallery with small images on the homepage and bigger ones on a different page. Here's the text from the original case:
 

Why does the module store the thumbs on disk in a fixed name folder? That's asking for a lot of trouble. Consider this scenario:

1. Let's say I have two pages, each with the Gallery module. One with a thumb size of 500x500 and one with 50x50 pointing to the same folder of high-res images
2. The first time I access 500x500.aspx the thumbs are generated and stored in GalleryThumbs with a width of 500x500
3. If I then access 50x50.aspx,  the thumbs are generated and stored in GalleryThumbs, overwriting the existing ones
4. If I then hit 500x500.aspx again, new thumbs are generated overwriting the old ones again.

This leads to at least two problems:
1. Caching is not as effective as it can be, as new thumbs are generated frequently
2. I run the risk of getting thumbs from paragraph 1 shown on paragraph 2 (with an incorrect size)

Why doesn't the module use the built-in GetImage.aspx handler that supports sizing, caching and what more.

 

Imar

 
Nicolai Høeg Pedersen
Reply
Hi Imar

Yes - that is a bug.

I've forwarded it to QA to check if it is already registered.

 
Maulik Kataria
Reply
That's good to know about GetImage.aspx.
However, Gallery module is regenerating images in GalleryImages folder every single time I refresh the page without pruge=true parameter.
 
Merethe Nielsen
Reply

Imar, I reproduced your problem and thank you for the steps to reproduce.

There is a problem with generation of thumbnails when using the same image folder on different pages - with different dimensions. The bug is 7281.

Maulik, I can't reproduce the issue, that it regenerates the images when loading without purge=true. Only when I open different pages that uses the same folder.

 
Maulik Kataria
Reply
Hi Merethe,

I am not sure why, but it happens on my side every single time. I am not sure of the reasons. May be I am missing some settings? If you want I can share the template I am using, if that could be helpful.

Thanks,
-Maulik

 
Merethe Nielsen
Reply

Maulik, If you could provide us with an url to your solution and the the show us the page, that have the problem, it would be easier to check what's happening.

 

You must be logged in to post in the forum