Tries to get the main article image. Will only update the metadata if the getMetadata function couldn't
find a correct image.
422851
public function getMainImage()
    {
        $imgUrl = false;

        if ($this->getImage() !== null) {
            $imgUrl = $this->getImage();
        }

        if (!$imgUrl) {
            foreach ($this->dom->getElementsByTagName('link') as $link) {
                /** @var \DOMElement $link */
                /*
                 * Check for the rel attribute, then check if the rel attribute is either img_src or image_src, and
                 * finally check for the existence of the href attribute, which should hold the image url.
                 */
                if ($link->hasAttribute('rel') && ($link->getAttribute('rel') === 'img_src' || $link->getAttribute('rel') === 'image_src') && $link->hasAttribute('href')) {
                    $imgUrl = $link->getAttribute('href');
                    break;
                }
            }
        }

        if (!empty($imgUrl) && $this->configuration->getFixRelativeURLs()) {
            $this->setImage($this->toAbsoluteURI($imgUrl));
        }
    }
327664
function() {
            // Get the resource's new metadata
            self.resources.get(createdResource.id, function(err, resource) {
                if (err) {
                    return callbacks.error(err);
                }

                // Check thumbnails
                var thumbnailsDone = _.chain(resource.thumbnails)
                    .filter({'status': 'pending'})
                    .isEmpty()
                    .value();
                if (thumbnailsDone) {
                    callbacks.thumbnails(resource.thumbnails);
                }

                // Check the images
                var imagesDone = _.chain(resource.images)
                    .filter({'status': 'pending'})
                    .isEmpty()
                    .value();
                if (imagesDone) {
                    callbacks.images(resource.images);
                }

                // If there are no pending processors left, we're done and can return to the caller
                if (resource.status !== 'pending') {
                    return callbacks.complete(resource);

                // Continue polling as long as there are still pending processors
                } else {
                    // Add a quarter of the polling timeout each time we check whether new updates
                    // are available. This will ensure that the interval gradually backs off.
                    pollingTimeout += Math.round(pollingTimeout / Embdr.DEFAULT_POLLING_BACKOFF_DENOMINATOR);
                    if (pollingTimeout > Embdr.MAX_POLLING_TIMEOUT) {
                        pollingTimeout = Embdr.MAX_POLLING_TIMEOUT;
                    }
                    setTimeout(poll, pollingTimeout);
                }
            });
        }
1348924
def metadata(self):
    
    if self._info is None:
      try:
        self._info = self._api.objects_get(self._bucket, self._key)
      except Exception as e:
        raise e
    return ObjectMetadata(self._info) if self._info else None
1332289
public void parseMetaData() {
    final ImageFormat imageFormat = ImageFormatChecker.getImageFormat_WrapIOException(
        getInputStream());
    mImageFormat = imageFormat;
    // BitmapUtil.decodeDimensions has a bug where it will return 100x100 for some WebPs even though
    // those are not its actual dimensions
    final Pair<Integer, Integer> dimensions;
    if (DefaultImageFormats.isWebpFormat(imageFormat)) {
      dimensions = readWebPImageSize();
    } else {
      dimensions = readImageMetaData().getDimensions();
    }
    if (imageFormat == DefaultImageFormats.JPEG && mRotationAngle == UNKNOWN_ROTATION_ANGLE) {
      // Load the JPEG rotation angle only if we have the dimensions
      if (dimensions != null) {
        mExifOrientation = JfifUtil.getOrientation(getInputStream());
        mRotationAngle = JfifUtil.getAutoRotateAngleFromOrientation(mExifOrientation);
      }
    } else if (imageFormat == DefaultImageFormats.HEIF
        && mRotationAngle == UNKNOWN_ROTATION_ANGLE) {
      mExifOrientation = HeifExifUtil.getOrientation(getInputStream());
      mRotationAngle = JfifUtil.getAutoRotateAngleFromOrientation(mExifOrientation);
    } else {
      mRotationAngle = 0;
    }
  }
18744
public org.tensorflow.framework.RunMetadata getMetadata() {
    return metadata_ == null ? org.tensorflow.framework.RunMetadata.getDefaultInstance() : metadata_;
  }
508439
def get_meta(filepath):
    
    meta = {}
    try:
        from PIL import Image
        with Image.open(filepath) as img:
            width, height = img.size
        meta['width'] = width
        meta['height'] = height
        meta['channels'] = len(img.mode)  # RGB, RGBA - does this always work?
    except ImportError:
        pass

    # Get times - creation, last edit, last open
    meta['file'] = mpu.io.get_file_meta(filepath)
    return meta
1050370
public function getMetaImageFolder()
    {
        if ($folder = $this->owner->config()->meta_image_folder) {
            return $folder;
        }
        
        return Config::inst()->get(self::class, 'default_meta_image_folder');
    }
411211
public function metaImage()
    {
        $context = $this->contextObject();

        $img = null;
        if ($context instanceof HasMetatagInterface) {
            $img = (string)$context['meta_image'];
        }

        if (!$img) {
            $img = (string)$this->fallbackMetaImage();
        }

        return $this->resolveMetaImage($img);
    }
114183
public function getMetaImage()
    {
        $metaImage = $this->getTranslationAttribute('meta_image');

        if ($metaImage = get_nuclear_cover($metaImage))
        {
            return $metaImage;
        }

        if ($coverImage = $this->getCoverImage())
        {
            return $coverImage;
        }

        return null;
    }
1183602
def get_image(verbose=False):
  """"""
  base_data = tf.constant(image_data(verbose=verbose))
  base_image = tf.image.decode_image(base_data, channels=3)
  base_image.set_shape((IMAGE_HEIGHT, IMAGE_WIDTH, 3))
  parsed_image = tf.Variable(base_image, name='image', dtype=tf.uint8)
  return parsed_image
975704
public function image()
    {
        if ($image = $this->articleImage()) {
            return $image;
        }
        if ($image = $this->introImage()) {
            return $image;
        }

        return config('article.image');
    }
459905
def get_asset_metadata(self, did):
        
        response = self.requests_session.get(f'{self._base_url}/metadata/{did}').content
        if not response:
            return {}
        try:
            parsed_response = json.loads(response)
        except TypeError:
            parsed_response = None
        except ValueError:
            raise ValueError(response.decode('UTF-8'))
        if parsed_response is None:
            return {}
        return parsed_response['metadata']
292821
function handleMeta(doc, title) {
  // If this is an image we need to not try and parse it
  if (imageRegex.test(title)) {
    return {}
  }
  const md = new MetaRemarkable()
  const page = md.render(doc)

  // Initialize an empty object
  let lowerMeta = {}

  // transform meta keys to lowercase (easier to work with)
  if (page.meta){
    lowerMeta = _.transform(page.meta, function (result, val, key) {
      result[key.toLowerCase()] = val
    })
  }
  return lowerMeta
}
133793
function searchGlobalMetadata(query, opts, callback) {
    if (typeof opts === 'function' && !callback) {
        callback = opts;
        opts = {};
    }

    var searchEndpointUrl = this.getResourceUrl({
        path: '/images',
        user: null,
        query: buildQuery(opts, true).toString()
    });

    request({
        method: 'SEARCH',
        uri: searchEndpointUrl.toString(),
        json: query,
        header: {
            'User-Agent': 'imboclient-js'
        },
        onComplete: function(err, res, body) {
            callback(
                err,
                body ? body.images : [],
                body ? body.search : {},
                res
            );
        }
    });

    return true;
}
424810
private ImageryMetaDataResource getMetaData() {
        Log.d(IMapView.LOGTAG, "getMetaData");

        ImageryMetaDataResource returnValue = null;

        InputStream in = null;
        HttpURLConnection client = null;
        ByteArrayOutputStream dataStream = null;
        BufferedOutputStream out = null;
        try {
            client = (HttpURLConnection) (new URL(String.format(BASE_URL_PATTERN, mStyle, mBingMapKey)).openConnection());
            Log.d(IMapView.LOGTAG, "make request " + client.getURL().toString().toString());
            client.setRequestProperty(Configuration.getInstance().getUserAgentHttpHeader(), Configuration.getInstance().getUserAgentValue());
            for (final Map.Entry<String, String> entry : Configuration.getInstance().getAdditionalHttpRequestProperties().entrySet()) {
                client.setRequestProperty(entry.getKey(), entry.getValue());
            }
            client.connect();

            if (client.getResponseCode() != 200) {
                Log.e(IMapView.LOGTAG, "Cannot get response for url " + client.getURL().toString() + " " + client.getResponseMessage());

            } else {

                in = client.getInputStream();
                dataStream = new ByteArrayOutputStream();
                out = new BufferedOutputStream(dataStream, StreamUtils.IO_BUFFER_SIZE);
                StreamUtils.copy(in, out);
                out.flush();

                returnValue = ImageryMetaData.getInstanceFromJSON(dataStream.toString());
            }
        } catch (final Exception e) {
            Log.e(IMapView.LOGTAG, "Error getting imagery meta data", e);
        } finally {
            if (client != null)
                try {
                    client.disconnect();
                } catch (Exception e) {
                    Log.d(IMapView.LOGTAG, "end getMetaData", e);
                }
            if (in != null)
                try {
                    in.close();
                } catch (Exception e) {
                    Log.d(IMapView.LOGTAG, "end getMetaData", e);
                }
            if (dataStream != null)
                try {
                    dataStream.close();
                } catch (Exception e) {
                    Log.d(IMapView.LOGTAG, "end getMetaData", e);
                }
            if (out != null)
                try {
                    out.close();
                } catch (Exception e) {
                    Log.d(IMapView.LOGTAG, "end getMetaData", e);
                }
            Log.d(IMapView.LOGTAG, "end getMetaData");
        }
        return returnValue;
    }
345898
def imagej_metadata(self):
        """"""
        if not self.is_imagej:
            return None
        page = self.pages[0]
        result = imagej_description_metadata(page.is_imagej)
        if 'IJMetadata' in page.tags:
            try:
                result.update(page.tags['IJMetadata'].value)
            except Exception:
                pass
        return result
153307
public function getMetadata($name = null)
    {
        if (is_null($name)) {
            return $this->metadata;
        }
        if (!isset($this->metadata[$name])) {
            return false;
        }
        return $this->metadata[$name];
    }