We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1416
    • 75 Posts
    I was going to try the 0.6 version, so yesterday I downloaded it from the trunk, rev 166.

    Deleted the old maxigallery, and uploaded the new one.
    Works great, I thought. (There was a bug in 0.5.2 when clicking the first image of an imageset using lightbox lightbox wouldn’t start, it just opened the image in the browser)

    So I checked that on my list and in 0.6 it work as it should. smiley

    But. I tried to upload new images. All I get is this error:

      Error:  exif_read_data(titania_002.jpg) [function.exif-read-data]: Incorrect APP1 Exif Identifier Code   
      Error type/ Nr.:  Warning - 2   
      File:  /www/webvol7/h2/xh63amxruziawfz/ungochbrostcancer.se/public_html/assets/snippets/maxigallery/maxigallery.class.inc.php   
      Line:  431   
      Line 431 source:  $exif = exif_read_data($this->path_to_gal.$name, 0, true);  


    So I thought it had something to do with just replacing the old files but keeping the images.
    Tried it on a new server, same error.

    Any ideas why?
      • 7923
      • 4,213 Posts
      Hmm.. didn’t find much info about it from google. That seems to happen when EXIF data is corrupted in the image files. Could it be that the EXIF data in your pictures has been corrupted? did you try several pictures?

      You can "fix" the issue by commenting lines 430 - 435 in /assets/snippets/maxigallery/maxigallery.class.inc.php.

      That same code has been in v0.5.2 too.. so I can’t understand why you would have started to get this when updating to v0.6.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 1416
        • 75 Posts
        Thanks for your quick reply Doze.

        At first I thought Photoshop CS4 messed up the EXIF, but none of the pictures I tried on 0.6 worked.
        So I tried the exact same pictures on 0.5.2 and it worked great.

        So I’m a bit stumped here.

        And the thing I mentioned with Lightbox seems to be some bug in Lightbox.
        Gonna see if helps to update all the .js that Lightbox uses. laugh
        If that fixes my problem I won’t try anything more for now. tongue

        Good thing I got a lot to do.

        Cheers
          • 7923
          • 4,213 Posts
          I have modified the lightbox js slightly, so you should compare the new one to the one in MaxiGallery and merge the new one over.

          I really don’t know what’s with the EXIF data reading.. because the same code is used in v0.6 and v0.5.2, but you can comment it from the class file. It only tries to read the date from exif data and use that if it exists, otherwise the upload date / time is used.


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 27147
            • 53 Posts
            I’ve been getting this same error with r166 till I commented that function out. (Helpful, huh!)
              • 27147
              • 53 Posts
              I’m trying to resize my thumbnails but I can’t find an equivalent to the code Bruno17 posted. Is there a ’native’ way to auto-regenerate missing tn_ files? If not, where should I add that code?
                • 27147
                • 53 Posts
                OK so I found where it should go, but this code is a bit dangerous as-is. It looks like there’s an SQL call that belongs in Bruno’s previous post so all the images in the gallery get deleted.

                Here’s the version that works (in r166):
                //add by Bruno
                					if (isset ($filesExist[$name])) {
                						//recreate thumb if deleted
                						if (!isset ($filesExist['tn_' . $name])) {
                					       		if (substr(strtolower($name), -4) == ".jpg" || substr(strtolower($name), -5) == ".jpeg") {
                								$retStr = $mg->createthumb($name, "jpeg", $mg->path_to_gal, "tn_");
                								if ($retStr != "") {
                									$handleMessage = $retStr;
                								}
                							} else
                								if (substr(strtolower($name), -4) == ".png") {
                									$retStr = $mg->createthumb($name, "png", $mg->path_to_gal, "tn_");
                									if ($retStr != "") {
                										$handleMessage = $retStr;
                									}
                								} else
                									if (substr(strtolower($name), -4) == ".gif") {
                										$retStr = $mg->createthumb($name, "gif", $mg->path_to_gal, "tn_");
                										if ($retStr != "") {
                											$handleMessage = $retStr;
                										}
                									}
                						}
                					}
                //end add by Bruno
                          
                					if (substr(strtolower($name),-5) != ".html" && $name != '..' && $name != '.' && strpos($name, 'tn_') !== 0 && strpos($name, 'big_') !== 0 && !array_key_exists($name, $filesExist)) {
                


                EDIT: and actually this seems a bit neater:
                //recreate thumb if deleted
                if (
                	isset ($filesExist[$name]) &&
                	!isset ($filesExist['tn_' . $name]) && (
                		in_array(
                			$fileExt=substr(strtolower($name), -4),
                			array('.jpg','.png','.gif')
                		) ||
                		$fileExt=substr(strtolower($name),-5) == '.jpeg'
                	) &&
                	$retStr = $mg->createthumb($name, $fileExt, $mg->path_to_gal, "tn_") != ""
                ) { $handleMessage = $retStr; }
                


                BTW I’m finding this a really handy feature. As well as resizing, you can also use it to tweak your compression settings. Thanks Bruno!
                  • 25483
                  • 741 Posts
                  Any news on the phpthumb integration? That is one of the features I really miss!
                    with regards,

                    Ronald Lokers
                    'Front-end developer' @ h2o Media

                    • 7923
                    • 4,213 Posts
                    Yes.. I won’t be adding phpThumb to MaxiGallery... I’ll use it for a future gallery resource for Revolution.

                    But you can already use phpThumb in MaxiGallery with the PHx phpThumb modifier. Use MaxiGallery to manage the pictures, but make it transfer just original images to the server (or for example do the coarse resizing if you are uploading very big images). Then use PHx phpThumb modifier in custom maxigallery templates to resize the pictures to actual sizes..

                    Here’s an example on how to use phpThumb modifier in MaxiGallery templates


                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                      • 25483
                      • 741 Posts
                      Quote from: doze at Dec 20, 2008, 11:03 AM

                      Yes.. I won’t be adding phpThumb to MaxiGallery... I’ll use it for a future gallery resource for Revolution.

                      But you can already use phpThumb in MaxiGallery with the PHx phpThumb modifier. Use MaxiGallery to manage the pictures, but make it transfer just original images to the server (or for example do the coarse resizing if you are uploading very big images). Then use PHx phpThumb modifier in custom maxigallery templates to resize the pictures to actual sizes..

                      Here’s an example on how to use phpThumb modifier in MaxiGallery templates

                      Yes I do it that way now, works good but it would be nice to get it built in maxigallery smiley

                      But I can live with the fact that it will be there in a gallery resource for Revolution, will it be based on MaxiGallery or will it work in a totally different way?
                        with regards,

                        Ronald Lokers
                        'Front-end developer' @ h2o Media