We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24731 ☆ A M B ☆
    • 211 Posts
    Hi all, I am trying to do something but have not found the exact how to on the documentation, I would appreciate if anyone would point me in the right direction.

    I’ve setup galleries for some content pages. So a news entry or an interview has its own gallery. Now, I am including some entries I specify in the homepage and for this I require a specific thumbnail size for different parts of the homepage. In certain ocasions this thumbnail can be the same size as the one on the content page, but on certain situations, this thumbnail will need to be smaller or bigger than the one created on the content page itself.

    Also I ran into some trouble when I tried to manually edit a thumbnail using TinyMCE to suit the homepage required size. After saving it, it would appear the system got corrupted and I got many error messages. I ended up having to delete the document and the gallery associated with it and creating a new one to get it working again. So I am not able to edit the thumbnails either?

    I appreciate your help.

    Thanks.

    Jose R. Lopez
      • 7923
      • 4,213 Posts
      You can display single pictures from MaxiGallery using the &gal_query_ids and &pic_query_ids parameters (see the query examples in modx wiki). Then in your call, use a custom galleryPictureTpl in what you set the size for the picture in the img tag.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 24731 ☆ A M B ☆
        • 211 Posts
        That will display an image in the size I specify, sure, but that’s not exactly what I want to do. I am already using those parameters with a custom template, the issue is, if an editor uploads an image that’s 1000 pixels wide, sure, It will display in the size I specify, but it will still add a huge load to the page since the image will be huge in KBs.

        So yeah, in a way, it does work, and that is actually what I am doing right now, but I think there are ways it could be optimized.

        I tried playing a bit with having different picture sizes for the same picture, like thumbnail, normal, big and on, but then that feature is limited to a set of 3 images sizes or 4 (can’t remember well) so there’s a limitation in the amount of sizes I can have for an image.

        It would be great if we could specify in the gallery call a size in width or height we want to display the image in. Then if the gallery does not find this image size it will generate it and store for future usage.

        Not sure how difficult would be to create something like that.

        But from your comment I understand what I want is not exactly available out of the box, so I need to continue and pursuit an alternative. I will give it some head and if I come up with any smart way to do it I will post it here for future reference.

        I do appreciate your inputs.

        Regards,
        Jose R. Lopez
          • 24731 ☆ A M B ☆
          • 211 Posts
          I think I could overcome the situation if I was able to mix together the ability to edit an image uploaded through maxigallery, have editors manually size when required and save it with a specific prefix so my configurations would be able to find it and display it automatically when available. This would only require the editor to crop or size through the editor the image in its proper aspect ratio or final size to be used.

          I know there is an image editor integrated in the Wysiwyg provided with the Framework, however, when I had initially tried changing a picture I had uploaded through MaxiGallery, I ended up with system errors, apparently MaxiGallery did not want me bothering in its images folder.

          Any hints anyone could provide me about this?

          Thanks.

          Jose R. Lopez
            • 7923
            • 4,213 Posts
            Yeah, currently you cannot do the way you want. You can have only 3 sizes of each picture. But in future, I will change the image processing logic to use phpThumb to generate the pictures and then you can have as many sizes you want for each picture (with what ever effects). See the phpThumb site if you’d like to help with this..


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 867
              • 241 Posts
              I think you should look after a snippet named DirectResize.