Title: dynamic thumbnail link structure
Last modified: August 22, 2016

---

# dynamic thumbnail link structure

 *  Resolved [UKF](https://wordpress.org/support/users/ukf/)
 * (@ukf)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/dynamic-thumbnail-link-structure/)
 * IMG_8430-nggid041624-ngg0dyn-400x0x100-00f0w010c010r110f110r010t010.jpg
    |————
   |———|—|—–|————-|—————|——————————————–| Image Name|—–|???|picID|—std–|—–size—–
   |———– std format——————-|
 * My question is now. From where are these two numbers generated ?
 * [https://wordpress.org/plugins/nextgen-gallery/](https://wordpress.org/plugins/nextgen-gallery/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/dynamic-thumbnail-link-structure/#post-5696385)
 * [@ukf](https://wordpress.org/support/users/ukf/) – Although the image filename
   is taken out of context in your example, you are correct in that it is dynamically
   created. The name is based on several factors such as the display(s), the thumbnail
   size(s), and how you are inserting the image(s).
 * What are you specifically looking for?
 * – Cais.
 *  Thread Starter [UKF](https://wordpress.org/support/users/ukf/)
 * (@ukf)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/dynamic-thumbnail-link-structure/#post-5696409)
 * I want to query this dynamic thumbnail. I want to show the previewpicture of 
   a specific gallery ID. This works with
 *     ```
       $gallery_id = "1";
       $results = $wpdb->get_results("SELECT ng.path, np.filename, np.description, np.alttext, np.pid, np.updated_at FROM wp_ngg_pictures np, wp_ngg_gallery ng WHERE np.galleryid=ng.gid AND np.galleryid=".$gallery_id." AND np.pid=ng.previewpic",ARRAY_A);
       		if(!empty($results[0]['path']) && !empty($results[0]['filename'])) :
       			$imgpaththumb = $results[0]['path'].'/thumbs/thumbs_'.$results[0]['filename'];
       ```
   
 * With this query I only get the normal thumbnail which has a size of width:300.
   In my dynamic folder is that thumbnail with width:400. How can I manually query
   that dynamic thumbnail ?
 *  [Benjamin](https://wordpress.org/support/users/benjaminowens/)
 * (@benjaminowens)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/dynamic-thumbnail-link-structure/#post-5696570)
 * The numbers are generated in nextgen-gallery/products/photocrati_nextgen/modules/
   dynamic_thumbnails/class.dynamic_thumbnails_manager.php in get_name_from_params()
 * The following code will retrieve the gallery & image and then give you the path
   to the image full URL, a dynamicly generated clone, and the official thumbnail:
 *     ```
       <?php
   
       $dynthumbs      = C_Dynamic_Thumbnails_Manager::get_instance();
       $gallery_mapper = C_Gallery_Mapper::get_instance();
       $image_mapper   = C_Image_Mapper::get_instance();
   
       $gallery = $gallery_mapper->find($gallery_id);
       if (!empty($gallery->previewpic) {
           $image = $image_mapper->find($gallery->previewpic);
           $dynamic_parameters = array(
               'width'  => '100',
               'height' => '100',
               'quality' => '100',
               'crop' => TRUE,
               'watermark' => FALSE
           );
           $thumbnail_size_name = $dynthumbs->get_size_name($dynamic_parameters);
           $full_url    = $storage->get_image_url($image, 'full');
           $dynamic_url = $storage->get_image_url($image, $thumbnail_size_name, TRUE);
           $thumb_url   = $storage->get_image_url($image, 'thumb');
       }
       ```
   
 * I hope that helps!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘dynamic thumbnail link structure’ is closed to new replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

## Tags

 * [link](https://wordpress.org/support/topic-tag/link/)
 * [structure](https://wordpress.org/support/topic-tag/structure/)
 * [thumbnail](https://wordpress.org/support/topic-tag/thumbnail/)

 * 3 replies
 * 3 participants
 * Last reply from: [Benjamin](https://wordpress.org/support/users/benjaminowens/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/dynamic-thumbnail-link-structure/#post-5696570)
 * Status: resolved