thumbnail view setup
550843
function (options, callback) {
			var sampleImageCategories = ['abstract', 'animals', 'business', 'cats', 'city', 'food', 'nature', 'technics', 'transport'];
			var numItems = 200;

			// build dataSource based with options
			var resp = {
				count: numItems,
				items: [],
				pages: (Math.ceil(numItems / (options.pageSize || 30))),
				page: options.pageIndex
			};

			// get start and end limits for JSON
			var i, l;
			i = options.pageIndex * (options.pageSize || 30);
			l = i + (options.pageSize || 30);
			resp.start = i + 1;
			resp.end = l;

			// add sample items to datasource
			for (i; i < l; i++) {
				resp.items.push({
					name: ('Thumbnail ' + (i + 1)),
					src: 'http://lorempixel.com/65/65/' + sampleImageCategories[Math.floor(Math.random() * 9)] + '/?_=' + i
				});
			}

			// call and simulate latency
			setTimeout(function () {
				callback(resp);
			}, loadDelays[Math.floor(Math.random() * 4)]);
		}
266816
def thumb(self, size=BIGTHUMB):
        ''''''
        if not self.is_image():
            return None
        if not size in (self.BIGTHUMB, self.MEDIUMTHUMB, self.SMALLTHUMB, self.XLTHUMB):
            raise JFSError('Invalid thumbnail size: %s for image %s' % (size, self.path))
        #return self.jfs.raw('%s?mode=thumb&ts=%s' % (self.path, size))
        return self.jfs.raw(url=self.path,
                            params={'mode':'thumb', 'ts':size})
1106975
def thumbnail(options = {})
      options = { geometry: nil, strip: false }.merge(options)
      geometry = convert_to_geometry(options[:geometry])
      thumbnail = image
      thumbnail = thumbnail.thumb(geometry) if geometry
      thumbnail = thumbnail.strip if options[:strip]
      thumbnail
    end
1320170
def thumbnail(tag: :div, **options, &block)
      content_tag(tag, nil, merge_predef_class('thumbnail', options)) do
        capture(&block)
      end
    end
857881
def THUMBNAIL_OPTIONS(self):
        
        from django.core.exceptions import ImproperlyConfigured

        size = self._setting('DJNG_THUMBNAIL_SIZE', (200, 200))
        if not (isinstance(size, (list, tuple)) and len(size) == 2 and isinstance(size[0], int) and isinstance(size[1], int)):
            raise ImproperlyConfigured("'DJNG_THUMBNAIL_SIZE' must be a 2-tuple of integers.")
        return {'crop': True, 'size': size}
917459
def thumbnail(self):
        
        if not self.status:
            return None

        images = self.status.images

        return images[0].url if images else None
849131
private void bindViews() {
        viewPager = (ViewPager) findViewById(R.id.vp);
        toolbar = (Toolbar) findViewById(R.id.toolbar);
    }
20299
def thumbnail(self):
        """"""

        if self.filetype not in ("video", "image", "audio"):
            raise RuntimeError("Only video, audio and image files can have thumbnails")
        thumb_srv = self.thumb.get("server")
        url = f"https://{thumb_srv}" if thumb_srv else None
        return f"{url}/asset/{self.fid}/thumb" if url else ""
243459
public function createThumbs()
    {
        $path = $this->getUploadedFilePath($this->attribute);
        foreach ($this->thumbs as $profile => $config) {
            $thumbPath = static::getThumbFilePath($this->attribute, $profile);
            if (is_file($path) && !is_file($thumbPath)) {

                // setup image processor function
                if (isset($config['processor']) && is_callable($config['processor'])) {
                    $processor = $config['processor'];
                    unset($config['processor']);
                } else {
                    $processor = function (GD $thumb) use ($config) {
                        $thumb->adaptiveResize($config['width'], $config['height']);
                    };
                }

                $thumb = new GD($path, $config);
                call_user_func($processor, $thumb, $this->attribute);
                FileHelper::createDirectory(pathinfo($thumbPath, PATHINFO_DIRNAME), 0775, true);
                $thumb->save($thumbPath);
            }
        }
    }
361584
private function setThumbsDetails()
    {
        $this->thumbsDetails = [];
        if ($this->isImage()) {
            $service = new ThumbService($this->package);
            collect($service->getSizes())->each(function ($size, $key) {
                $this->thumbsDetails[$key] = [
                    'size' => $key,
                    'width' => $size[0],
                    'height' => $size[1],
                    'url' => $this->getUrl($key . '/' . $this->path)
                ];
            });
        }
    }
1325164
def renderThumbnail(self, relpath=""):
        """"""
        # no thumbnail -- return empty string
        if self.thumbnail is None:
            return ""
        # else thumbnail is same as full image (because image was small enough), insert directly
        elif self.thumbnail is self.fullimage:
            fname = relpath + self.fullimage
            return """<IMG SRC="%s" ALT="%s"></IMG>""" % (quote_url(fname), quote_url(os.path.basename(self.filename)))
        # else return thumbnail linking to full image
        else:
            tname = relpath + self.thumbnail
            fname = relpath + self.fullimage
            return """<A HREF="%s"><IMG SRC="%s" ALT="%s"></A>""" % (
            quote_url(fname), quote_url(tname), quote_url(os.path.basename(self.filename)))
626776
def setup_toolbar(self):
        """"""
        savefig_btn = create_toolbutton(
                self, icon=ima.icon('filesave'),
                tip=_("Save Image As..."),
                triggered=self.save_figure)

        saveall_btn = create_toolbutton(
                self, icon=ima.icon('save_all'),
                tip=_("Save All Images..."),
                triggered=self.save_all_figures)

        copyfig_btn = create_toolbutton(
            self, icon=ima.icon('editcopy'),
            tip=_("Copy plot to clipboard as image (%s)" %
                  get_shortcut('plots', 'copy')),
            triggered=self.copy_figure)

        closefig_btn = create_toolbutton(
                self, icon=ima.icon('editclear'),
                tip=_("Remove image"),
                triggered=self.close_figure)

        closeall_btn = create_toolbutton(
                self, icon=ima.icon('filecloseall'),
                tip=_("Remove all images from the explorer"),
                triggered=self.close_all_figures)

        vsep1 = QFrame()
        vsep1.setFrameStyle(53)

        goback_btn = create_toolbutton(
                self, icon=ima.icon('ArrowBack'),
                tip=_("Previous Figure ({})".format(
                      get_shortcut('plots', 'previous figure'))),
                triggered=self.go_previous_thumbnail)

        gonext_btn = create_toolbutton(
                self, icon=ima.icon('ArrowForward'),
                tip=_("Next Figure ({})".format(
                      get_shortcut('plots', 'next figure'))),
                triggered=self.go_next_thumbnail)

        vsep2 = QFrame()
        vsep2.setFrameStyle(53)

        zoom_out_btn = create_toolbutton(
                self, icon=ima.icon('zoom_out'),
                tip=_("Zoom out (Ctrl + mouse-wheel-down)"),
                triggered=self.zoom_out)

        zoom_in_btn = create_toolbutton(
                self, icon=ima.icon('zoom_in'),
                tip=_("Zoom in (Ctrl + mouse-wheel-up)"),
                triggered=self.zoom_in)

        self.zoom_disp = QSpinBox()
        self.zoom_disp.setAlignment(Qt.AlignCenter)
        self.zoom_disp.setButtonSymbols(QSpinBox.NoButtons)
        self.zoom_disp.setReadOnly(True)
        self.zoom_disp.setSuffix(' %')
        self.zoom_disp.setRange(0, 9999)
        self.zoom_disp.setValue(100)
        self.figviewer.sig_zoom_changed.connect(self.zoom_disp.setValue)

        zoom_pan = QWidget()
        layout = QHBoxLayout(zoom_pan)
        layout.setSpacing(0)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.addWidget(zoom_out_btn)
        layout.addWidget(zoom_in_btn)
        layout.addWidget(self.zoom_disp)

        return [savefig_btn, saveall_btn, copyfig_btn, closefig_btn,
                closeall_btn, vsep1, goback_btn, gonext_btn, vsep2, zoom_pan]
380201
def _create_thumbnail(self, source_image, geometry_string, options,
                          thumbnail):
        
        logger.debug('Creating thumbnail file [%s] at [%s] with [%s]',
                     thumbnail.name, geometry_string, options)
        ratio = default.engine.get_image_ratio(source_image, options)
        geometry = parse_geometry(geometry_string, ratio)
        image = default.engine.create(source_image, geometry, options)
        default.engine.write(image, options, thumbnail)
        # It's much cheaper to set the size here
        size = default.engine.get_image_size(image)
        thumbnail.set_size(size)
57977
def _set_view(self):
        """"""
        if self.logarithmic:
            view_class = HorizontalLogView
        else:
            view_class = HorizontalView

        self.view = view_class(
            self.width - self.margin_box.x, self.height - self.margin_box.y,
            self._box
        )
677732
function NodeView() {
        View.apply(this, arguments);

        /** @member {number} */
        this.left = 0;

        /** @member {number} */
        this.top = 0;

        /** @member {number} */
        this.width = 0;

        /** @member {number} */
        this.height = 0;

        /** @member {number} */
        this.minWidth = 0;

        /** @member {number} */
        this.minHeight = 0;

        /** @member {number} */
        this.sizable = SZ_FREE;

        /** @member {number} */
        this.movable = MM_FREE;

        /** @member {Boolean} */
        this.autoResize = false;
    }
67551
public function setup()
    {
        if ($this->enabled())
        {
            $this->hookupUI();

            add_action('admin_enqueue_scripts', [$this,'enqueueTheGoods']);
            add_action('wp_ajax_ilab_crop_image_page',[$this,'displayCropUI']);
            add_action('wp_ajax_ilab_perform_crop',[$this,'performCrop']);

            add_filter('ilab_s3_process_crop', function($size, $path, $sizeMeta){
                return $sizeMeta;
            }, 3, 3);
            add_filter('ilab_s3_process_file_name', function($filename) {
                return $filename;
            }, 3, 1);
        }
    }
283359
public static function setNailsJs()
    {
        $oAsset     = Factory::service('Asset');
        $aVariables = [
            'ENVIRONMENT' => Environment::get(),
            'SITE_URL'    => site_url('', Functions::isPageSecure()),
            'NAILS'       => (object) [
                'URL'  => NAILS_ASSETS_URL,
                'LANG' => (object) [],
                'USER' => (object) [
                    'ID'    => activeUser('id') ? activeUser('id') : null,
                    'FNAME' => activeUser('first_name'),
                    'LNAME' => activeUser('last_name'),
                    'EMAIL' => activeUser('email'),
                ],
            ],
        ];
        foreach ($aVariables as $sKey => $mValue) {
            $oAsset->inline('window.' . $sKey . ' = ' . json_encode($mValue) . ';', 'JS', 'HEADER');
        }
    }