Forum Replies Created

Viewing 15 replies - 106 through 120 (of 348 total)
  • Benjamin

    (@benjaminowens)

    It’s possible your limits are too low for the size of the images being edited; unfortunately those amounts can require up to five times the original image file size. Can you try raising those and see if image uploads work then?

    Benjamin

    (@benjaminowens)

    I’m sorry, we don’t have a way to do that automatically 🙁

    Benjamin

    (@benjaminowens)

    All you have to do is place that file in your /wp-content/ and activate it on the Plugins page.

    The photo data is stored in the $image variable, it will look something like this:

    stdClass Object
    (
        [pid] => 44
        [image_slug] => 00067201
        [galleryid] => 2
        [filename] => 00067201.jpg
        [description] => Dido and Aeneas; Nicolas Verkolye (Dutch, 1673 - 1746); The Netherlands; early 18th century; Oil on canvas; 90.2 × 117.5 cm (35 1/2 × 46 1/4 in.); 71.PA.66
        [alttext] => Dido and Aeneas
        [imagedate] => 2021-01-19 20:48:26
        [exclude] => 0
        [sortorder] => 0
        [meta_data] => Array
            (
                [aperture] => 
                [credit] => 
                [camera] => 
                [caption] => Dido and Aeneas; Nicolas Verkolye (Dutch, 1673 - 1746); The Netherlands; early 18th century; Oil on canvas; 90.2 × 117.5 cm (35 1/2 × 46 1/4 in.); 71.PA.66
                [created_timestamp] => 
                [copyright] => 
                [focal_length] => 
                [iso] => 
                [shutter_speed] => 
                [flash] => 
                [title] => Dido and Aeneas
                [keywords] => 
                [width] => 1024
                [height] => 787
                [saved] => 1
                [backup] => Array
                    (
                        [filename] => 00067201.jpg
                        [width] => 1024
                        [height] => 787
                        [generated] => 0.30013000 1611089306
                    )
    
                [md5] => 87ce08db7fdf6a81534a7dfc42af55a8
                [full] => Array
                    (
                        [width] => 1024
                        [height] => 787
                        [md5] => 87ce08db7fdf6a81534a7dfc42af55a8
                    )
    
                [thumbnail] => Array
                    (
                        [width] => 240
                        [height] => 160
                        [filename] => thumbs_00067201.jpg
                        [generated] => 0.58162500 1611089306
                    )
    
                [ngg0dyn-480x320x100-00f0w010c011r110f110r010t010] => Array
                    (
                        [width] => 480
                        [height] => 320
                        [filename] => 00067201.jpg-nggid0244-ngg0dyn-480x320x100-00f0w010c011r110f110r010t010.jpg
                        [generated] => 0.74623700 1611089306
                    )
    
            )
        [updated_at] => 1611089306
    )

    As long as your camera includes the date in the photo metadata (and they all do by default I believe) the code I gave will use the date the photo was taken. To use the date of upload just remove the parameter given to “\new DateTime()`

    You’re not demanding at all! It’s great for us to see how our users actually use our software and how we can improve it 🙂 I’ve submitted your idea of templating image descriptions to our feature wishlist, thanks!

    Benjamin

    (@benjaminowens)

    If you aren’t targeting users with high DPI screens (“retina”) could you try turning off the “resize images at upload” option and clearing your image cache? With that option disabled NextGEN will not attempt to process it and will just accept the image file as is.

    Benjamin

    (@benjaminowens)

    Sorry franco30; the above code is PHP that will inject the necessary CSS in the right place. I like to place such site tweaks in their own plugin, just place this below code into a file and upload it to your /wp-content/

    <?php
    /*
     * Plugin Name: example.org site tweaks
     * Description: Adjusts NextGEN page anchor colors
     * Version: 0.1
     * Plugin URI: https://example.org/
     * Author: Your Name Here
     * Author URI: https://example.org/
     * License: GPLv2
     */
    
    add_action('admin_head', function() {
        echo '<style>
            #ngg_page_content a {
                color: blue;
            }
        </style>';
    });

    and then activate it; then that bit of CSS will be added to all of your wp-admin pages.

    Benjamin

    (@benjaminowens)

    Sorry @sfredb, proofing was accidentally broken in the last release. There is a fixed beta available if you login to your members page, and we will be releasing an update on Tuesday the 12th that will include a fix!

    Benjamin

    (@benjaminowens)

    I like to place site tweaks and adjustments in their own plugin specific to that site.

    Create a file named “exampleDotOrgTweaks.php” and place it in wp-content/plugins/:

    <?php
    /*
     * Plugin Name: example.org Site Tweaks
     * Description: Custom modifications for example.org
     * Version: 0.1
     * Plugin URI: https://example.org/
     * Author: Your Name Here
     * Author URI: https://example.org/
     */
    
    add_action('ngg_added_new_image', function($image) {
        if (empty($image->description))
        {
            $mapper = C_Image_Mapper::get_instance();
            $date = new \DateTime($image->imagedate);
            $image->description = $date->format('F j, Y');
            $mapper->save($image);
        }
    });

    I hope that helps!

    Benjamin

    (@benjaminowens)

    I’m sorry but we just can’t allow HTML in image titles / descriptions because it could be a security risk to some of our users.

    I have added an issue to our bug tracker to make that configurable if you are willing to take on the possible risk (namely if you delegate gallery management those people could then attempt to launch an XSS attack on you and escalate their user). It may not be in this next release, but I’ll try to ensure it’s included soon.

    Benjamin

    (@benjaminowens)

    No, there is not. Sorry

    Benjamin

    (@benjaminowens)

    I don’t believe that child theme CSS is loaded in the WP-Admin. You’ll need to do something like this:

    add_action('admin_head', function() {
        echo '<style>
            #ngg_page_content a {
                color: blue;
            }
        </style>';
    });
    Benjamin

    (@benjaminowens)

    I’m so sorry for the inconvenience @msmith119. I’ve fixed the issue this morning I believe and it will be included in the next release.

    The core issue is that images were being rotated so that they would appear correctly without the EXIF Orientation tag (which not all browsers support) but that tag remained causing some browsers to display those images rotated anyway. As part of my fix I’ve added a new option to the Manage Gallery page’s “Bulk actions” dropdown which will just remove that Orientation metadata from all of the images selected.

    That will mean some minor hassle for you to go through each gallery, select all the images, and run that operation, but it’s at least better than having to create new galleries and upload it all again I hope!

    Benjamin

    (@benjaminowens)

    Quick question, is there a way to automatically put the description of a photo to be the FILE NAME? Or perhaps, if theres no description, show the file name or date in which photo was taken?

    The following will run every time an image is added to NextGEN Gallery and if there is no description will replace it with “January 6, 2021”:

    add_action('ngg_added_new_image', function($image) {
        if (empty($image->description))
        {
            $mapper = C_Image_Mapper::get_instance();
            $date = new \DateTime($image->imagedate);
            $image->description = $date->format('F j, Y');
            $mapper->save($image);
        }
    });

    You can find a list of formatting codes on the php.net documentation for DateTime.

    Thanks again @polywogg for all your work here!

    Benjamin

    (@benjaminowens)

    That’s definitely not right. Have you tried using the Other Options > Misc > Clear image cache feature? It would cause those images to be regenerated; so that page may slow the first time it loads but hopefully the images will generate correctly.

    Benjamin

    (@benjaminowens)

    I can reproduce this problem; it appears our last release broke how we automatically rotate images with the EXIF Orientation tag so that the image is upright before removing that tag. At the time only Safari displayed images correctly, now Chrome does as well but I believe Firefox will still show images without honoring the Orientation tag.

    I’ve added this to our bug tracker, and I will make sure that it’s part of our next release! My apologies to everybody with this issue; I did lots of EXIF metadata testing for our last release but neglected to test this one scenario.

    Benjamin

    (@benjaminowens)

    Sorry for the delay answering questions here, we’ve been pretty busy (or just on vacation) with the holidays.

    I want to be able to have the gallery description appear above the thumbnails. I was able to do this using the legacy templates, but using the newer one I have not figured out how to do this.

    NextGEN 1x only allowed a single gallery at a time to be displayed which made it easy, but NextGEN 2 is pretty versatile and lets you mix multiple galleries. So the code I’m posting here will show the first gallery’s title, it’s up to you how to handle multiple galelries if you want to at all. This will only apply if your image source is from galleries; this won’t work if you’re displaying images based on tags or recently uploaded images. I can help if you need those though! 🙂

    if ($displayed_gallery->source === 'galleries' && !empty($displayed_gallery->container_ids)) {
        $gallery = C_Gallery_Mapper::get_instance()->find($displayed_gallery->container_ids[0]);
        print '<h1>' . $gallery->title . '</h1>';
    }

    Just use galdesc instead of title to show the gallery description.

    In addition, is the template=caption shortcode going to work once this change is made? I want the caption to appear below each thumbnail.

    The template parameter is not changing, it will always be used for the legacy template feature. The new templates use the parameter display_view and it can be used like so: display_view="custom/gallery-with-title-view.php"

    The shortcode is generated automatically for you if you use our popup window in the classic or block editor.

    @postmastergs Thanks for your advice here! Your suggestion for adding descriptions under thumbnails is just fine.

    @quicksilver03 as PostmasterGS said there is a requirement that the custom templates be named “-template.php” or “-view.php” and you need to use the new display_view parameter instead of “template” as I wrote above.

    I also want to reassure you that this feature isn’t going to be permanently discarded for quite for some time; we will most likely disable it but introduce a constant to bring it back and then later remove it from NextGEN but move it into a (free of course) companion plugin for those that still must use it.

    • This reply was modified 5 years, 6 months ago by Benjamin.
Viewing 15 replies - 106 through 120 (of 348 total)