Returns True if we already have a thumbnail version of this image
        cached, False otherwise.
182202
def have_thumbnail(self, fitsimage, image):
        
        chname = self.fv.get_channel_name(fitsimage)

        # Look up our version of the thumb
        idx = image.get('idx', None)
        path = image.get('path', None)
        if path is not None:
            path = os.path.abspath(path)
            name = iohelper.name_image_from_path(path, idx=idx)
        else:
            name = 'NoName'

        # get image name
        name = image.get('name', name)

        thumbkey = self.get_thumb_key(chname, name, path)
        with self.thmblock:
            return thumbkey in self.thumb_dict
489522
def get_thumbnails(self, *args, **kwargs):
        
        # First, delete any related thumbnails.
        source_cache = self.get_source_cache()
        if source_cache:
            thumbnail_storage_hash = utils.get_storage_hash(
                self.thumbnail_storage)
            for thumbnail_cache in source_cache.thumbnails.all():
                # Only iterate files which are stored using the current
                # thumbnail storage.
                if thumbnail_cache.storage_hash == thumbnail_storage_hash:
                    yield ThumbnailFile(name=thumbnail_cache.name,
                                        storage=self.thumbnail_storage)
374031
public function ModernoLogoImageExists()
    {
        if ($image = $this->owner->ModernoLogoImage()) {
            return ($image->exists() && file_exists($image->getFullPath()));
        }
        
        return false;
    }
186670
public boolean containsThumbnail(int userPage, int page, float width, float height, RectF pageRelativeBounds) {
        PagePart fakePart = new PagePart(userPage, page, null, width, height, pageRelativeBounds, true, 0);
        for (PagePart part : thumbnails) {
            if (part.equals(fakePart)) {
                return true;
            }
        }
        return false;
    }
1110176
def get_existing_thumbnail(self, thumbnail_options, high_resolution=False):
        
        thumbnail_options = self.get_options(thumbnail_options)
        names = [
            self.get_thumbnail_name(
                thumbnail_options, transparent=False,
                high_resolution=high_resolution)]
        transparent_name = self.get_thumbnail_name(
            thumbnail_options, transparent=True,
            high_resolution=high_resolution)
        if transparent_name not in names:
            names.append(transparent_name)

        for filename in names:
            exists = self.thumbnail_exists(filename)
            if exists:
                thumbnail_file = ThumbnailFile(
                    name=filename, storage=self.thumbnail_storage,
                    thumbnail_options=thumbnail_options)
                if settings.THUMBNAIL_CACHE_DIMENSIONS:
                    # If this wasn't local storage, exists will be a thumbnail
                    # instance so we can store the image dimensions now to save
                    # a future potential query.
                    thumbnail_file.set_image_dimensions(exists)
                return thumbnail_file
858628
public function getThumbnail() : bool
    {
        if (!isset($this->params['v'])) {
            $this->params['thumbnail'] = '';
            return false;
        }

        $this->params['thumbnail'] =  'https://i.ytimg.com/vi/' . $this->params['v'] . '/hqdefault.jpg';
        return true;
    }
739366
protected function useCache()
    {
        // Should we use a cached version?
        if ($this->cache && $this->cacheExists()) {
            $this->templateOutput = $this->getCache();
            if ($this->templateOutput !== false) {
                return true;
            }
        }
        return false;
    }
120112
def get_thumbnail_image(self, page=1):
        
        url = self.get_thumbnail_image_url(page=page)
        return self._get_url(url)
194149
def clear_thumbnails(self):
        ''''''
        state = self.state
        for l in state.layers:
            keys = state.layers[l].keys()[:]
            for key in keys:
                if (isinstance(state.layers[l][key], SlipThumbnail)
                    and not isinstance(state.layers[l][key], SlipIcon)):
                    state.layers[l].pop(key)
316586
function isLoaded (url) {
        if (urls[url] == true) {
            return true;
        }

        var image = new Image();
        image.src = url;
        if (image.complete) {
            return true;
        }

        return false;
    }
1229024
def is_image(self, key):
        """"""
        data = self.model.get_data()
        return isinstance(data[key], Image)
1214276
private function _cached_required()
    {
        $image_info = getimagesize($this->source_file);
        
        if (($this->url_params['w'] == $image_info[0]) and ($this->url_params['h'] == $image_info[1])) {
            $this->serve_default = TRUE;
            return FALSE;
        }
        
        return TRUE;
    }
368019
public function thumbExists()
    {
        $thumb = $this->getThumbRealPath();
        return !empty($thumb) && @file_exists($thumb) && @is_file($thumb);
    }
182917
public boolean isInBitmapMemoryCache(final ImageRequest imageRequest) {
    if (imageRequest == null) {
      return false;
    }
    final CacheKey cacheKey = mCacheKeyFactory.getBitmapCacheKey(imageRequest, null);
    CloseableReference<CloseableImage> ref = mBitmapMemoryCache.get(cacheKey);
    try {
      return CloseableReference.isValid(ref);
    } finally {
      CloseableReference.closeSafely(ref);
    }
  }
892124
def has_custom_image(user_context, app_id):
  """"""
  possible_paths = _valid_custom_image_paths(user_context, app_id)
  return any(map(os.path.exists, possible_paths))
1063976
function isImageOwner()
    {
        $originalData = $this->originalAttributeData();
        return ( $originalData['attribute_id'] == false ||
                 ( $originalData['attribute_id'] == $this->ContentObjectAttributeData['id'] &&
                   $originalData['attribute_version'] == $this->ContentObjectAttributeData['version'] &&
                   $originalData['attribute_language'] == $this->ContentObjectAttributeData['language_code'] ) );
    }
415383
private boolean checkInStagingAreaAndFileCache(final CacheKey key) {
    EncodedImage result = mStagingArea.get(key);
    if (result != null) {
      result.close();
      FLog.v(TAG, "Found image for %s in staging area", key.getUriString());
      mImageCacheStatsTracker.onStagingAreaHit(key);
      return true;
    } else {
      FLog.v(TAG, "Did not find image for %s in staging area", key.getUriString());
      mImageCacheStatsTracker.onStagingAreaMiss();
      try {
        return mFileCache.hasKey(key);
      } catch (Exception exception) {
        return false;
      }
    }
  }