Support » Plugin: NextGEN Gallery - WordPress Gallery Plugin » Updating images in the dynamic folder when uploadng new images

  • I’m writing something that uses xmlrpc to replace existing images in a Nextgen gallery. The gallery itself is being displayed by a custom gallery that uses the code below to make dynamically resized images. My uploader uses the xmlrpc method ‘ngg.uploadImage’ to upload a new image. This is all working fine except that I still have the old dynamically resized images in the ‘dynamic’ sub folder of the gallery. How do I force an update of these resized images?

    thanks.

    
    $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance();
    $size = $dynthumbs->get_size_name(array(
        'width'     => $MaxImageWidth/$columns,
        'height'    => $MaxImageWidth/$columns,
        'crop'      => FALSE,
        'watermark' => FALSE
    ));
    $src = $storage->get_image_url($image, $size);
    
Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author photocrati

    (@photocrati)

    @kimaldis – The dynamic folder contains all references to the images that are not the same as the original image and/or their default thumbnails as used across the entire site. These are generally created as needed for the specific display(s) that requires different sizes.

    Also to note, we are considering removing the XML-RPC module/code from our plugin and moving it into an extension of NextGEN Gallery, you might want to take that into consideration going forward as well.

    Thanks!

    – Cais.

    Yes, I know what they are. What I want to know, though, is how I to force them to update when I replace a master image?

    When you say “move it”; will it still be xmlrpc?

    When you say “you might want to take that into consideration going forward”; can you give me a bit more to go on?

    thanks.

    Plugin Author photocrati

    (@photocrati)

    @kimaldis – Since we do not use the XML-RPC code/modules ourselves we are considering moving it into an extension plugin to reduce the main NextGEN Gallery plugin size and maintenance.

    As noted, dynamic images are created when the original image’s details are changed for a specific display, to replace the dynamic images when you replace the “master” image programmatically would require all of the same processes that are triggered by the user via the UI. You should be able to trace those through and complete the “automation” of the processes.

    – Cais.

    OK, thanks. Although it’s a shame that uploadImage doesn’t do its job properly.

    Plugin Author photocrati

    (@photocrati)

    @kimaldis – We’re not seeing any issues with our methods working incorrectly, can you explain why you are making this statement:

    … uploadImage doesn’t do its job properly.

    Thanks!

    – Cais.

    If an image is being replaced by a new one, any dynamic images associated with it should also be replaced.

    Plugin Author photocrati

    (@photocrati)

    @kimaldis – If the image is deleted I would expect the related images (as in the relevant dynamic images and thumbnails) would be deleted as well; but, to inject a replacement image, it does not surprise me the related dynamic images are not being replaced as they are created (essentially) with display not at upload.

    Thanks!

    – Cais.

    If an existing image is being replaced it makes sense to me that the dynamic images would be deleted. If you don’t then you’re left with dynamic images that don’t match the actual image in the database. If you do delete them then they’re automatically re-generated when a display that needs them is next viewed.

    If you don’t delete them then I have to write a plugin to do the job, unless I’ve missed something, because it can only be done at the server end. Unless you can add an xmlrpc method to delete them?

    I don’t mind adding a plugin, particularly, but it seems like a troublesome way to do it to me.

    Plugin Author photocrati

    (@photocrati)

    @kimaldis – It appears you are expecting your inserted images to trigger the full process of our removal methods.

    As it is, during regular usage of our plugin, the dynamic images are only generated when there is a reason for them to exist based on an inserted display that uses images not the same size as the “defaults” available.

    I believe your current process is not taking that into account.

    – Cais.

    Yes, I understand how this works. But I’m doing the update remotely using your xmlrpc calls which have no support for removing these cached images. If the master image is removed or replaced their should be a method in your xmlrpc calls to remove or update the cache file associated with it. The idea that cached versions of any file should be left dangling when the master is changed is, frankly, a bit odd.

    Plugin Author photocrati

    (@photocrati)

    @kimaldis – As previously noted, we do not use the XML-RPC call ourselves and are considering removing it as is. Given your findings, they are providing more impetus to do so sooner rather than later. I’ll point our developers to this thread so they are aware of possible issues if an extension plugin is generated during the refactoring.

    Thanks!

    – Cais.

    thanks. Can I request that you open source this if you are going to distance yourself from it. It’s a useful tool and I’d hate to see it fall off the edge of the table. Github would be nice.

    Plugin Author photocrati

    (@photocrati)

    @kimaldis – Everything we write is licensed under the GPLv2 license, I would imagine at the least it will be available on our Bitbucket repository.

    Thanks!

    – Cais.

    That would be great. Thanks for your time.

    Plugin Author photocrati

    (@photocrati)

    @kimaldis – You would also be welcome to submit PR items relevant to the XML-RPC module/methods as well … before or after it is moved into its own plugin.

    – Cais.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Updating images in the dynamic folder when uploadng new images’ is closed to new replies.