Returns a JSON format of the image width, height, name, mime ...

@return string
357639
public function getJson()
    {
      return json_encode(
        array(
          'name' => $this->name,
          'mime' => $this->mime,
          'height' => $this->height,
          'width' => $this->width,
          'size' => $this->_files['size'],
          'location' => $this->location,
          'fullpath' => $this->fullPath,
        )
      );
    }
370277
public function jsonSerialize()
    {
        return [
            'name' => $this->name(),
            'type' => $this->type(),
            'files_count' => $this->filesCount(),
            'size' => $this->size(),
            'uploaded_bytes' => $this->uploadedBytes(),
            'downloaded_bytes' => $this->downloadedBytes(),
        ];
    }
203418
public static function convertImageJson($json): string
    {
        if (empty($json))
            return "";
        elseif (is_array($json) && !empty($json[0]['url']))
            return HOME . str_replace('\\', '/', $json[0]['url']);
        elseif (Check::isJson($json) && preg_match('/url/i', $json))
            return HOME . str_replace('\\', '/', json_decode($json, true)[0]['url']);

        return "";
    }
1274091
private function _getFormat(){
        $format = '';
        switch(strtoupper($this->format)){
            case 'PNG':
                $format = CINDrawing::IMG_FORMAT_PNG;
                break;
            case 'JPEG':
                $format = CINDrawing::IMG_FORMAT_JPEG;
                break;
            case 'GIF':
                $format = CINDrawing::IMG_FORMAT_GIF;
                break;
            case 'WBMP':
                $format = CINDrawing::IMG_FORMAT_WBMP;
                break;
            default:
                $format = CINDrawing::IMG_FORMAT_PNG;
                break;
        }
        return $format;
    }
96298
public function serialize()
    {
        $request = $this->requestStack->getCurrentRequest();

        $logo = $this->fileUtilities->getOneBy([
            'url' => $this->config->getParameter('logo'),
        ]);

        return [
            'maintenance' => MaintenanceHandler::isMaintenanceEnabled(),
            'logo' => $logo ? [
                'url' => $logo->getUrl(),
                'colorized' => 'image/svg+xml' === $logo->getMimeType(),
            ] : null,
            'logo_redirect_home' => $this->config->getParameter('logo_redirect_home'),
            'name' => $this->config->getParameter('name'),
            'secondaryName' => $this->config->getParameter('secondary_name'),
            'description' => null, // the one for the current locale
            'version' => $this->versionManager->getDistributionVersion(),
            'environment' => $this->env,
            'links' => $this->serializeLinks(),
            'asset' => $this->assets->getUrl(''),
            'server' => [
                'protocol' => $request->isSecure() || $this->config->getParameter('ssl_enabled') ? 'https' : 'http',
                'host' => $this->config->getParameter('domain_name') ? $this->config->getParameter('domain_name') : $request->getHost(),
                'path' => $request->getBasePath(),
            ],
            'theme' => $this->serializeTheme(),
            'locale' => $this->serializeLocale(),
            'openGraph' => [
                'enabled' => $this->config->getParameter('enable_opengraph'),
            ],
            'resources' => [
                'types' => array_map(function (ResourceType $resourceType) {
                    return $this->resourceTypeSerializer->serialize($resourceType);
                }, $this->om->getRepository('ClarolineCoreBundle:Resource\ResourceType')->findAll()),
                'softDelete' => $this->config->getParameter('resource.soft_delete'),
            ],
            'plugins' => $this->pluginManager->getEnabled(true),
            'javascripts' => $this->config->getParameter('javascripts'),
        ];
    }
5863
public function getImageSize($Image = null) {
		$Image = $this->_getImage($Image);
		$BoxInterface = $Image->getSize($Image);
		return [
			$BoxInterface->getWidth(),
			$BoxInterface->getHeight(),
			'x' => $BoxInterface->getWidth(),
			'y' => $BoxInterface->getHeight()
		];
	}
1275538
def format_photo_json(self, request, photo, format):
        ""
        try:
            photo = get_cached_object(Photo, pk=photo)
            format = get_cached_object(Format, pk=format)
            content = {
                'error': False,
                'image':settings.MEDIA_URL + photo.image,
                'width':photo.width,
                'height': photo.height,
                'format_width':format.max_width,
                'format_height':format.max_height
            }
        except (Photo.DoesNotExist, Format.DoesNotExist):
            content = {'error':True}
        return HttpResponse(simplejson.dumps(content))
834393
public function getJson()
    {
        if (!isset($this->json)) {
            $this->json = json_decode($this->getProp('dump-single-json'));
        }

        return $this->json;
    }
1063307
private function mapImage(): array
    {
        $previewUri = $this->resourceManager->getPublicPersistentResourceUri($this->image->getResource());

        return [
            'previewUri' => $previewUri,
            'width' => $this->image->getWidth(),
            'height' => $this->image->getHeight(),
            'persistenceIdentifier' => $this->persistenceManager->getIdentifierByObject($this->image)
        ];
    }
1007113
public function getBannerImageSizes()
    {
        $sizes = array();
        $imageSize = $this->Database
                            ->prepare("SELECT id, name, width, height FROM tl_image_size ORDER BY pid, name")
                            ->execute(\Input::get('id'));
        while ($imageSize->next())
        {
            $sizes[$imageSize->id] = $imageSize->name;
            $sizes[$imageSize->id] .= ' (' . $imageSize->width . 'x' . $imageSize->height . ')';
        }
        return array_merge(array('image_sizes'=>$sizes), $GLOBALS['TL_CROP']);
    }
998847
private function getThemeImageSizes()
    {
        $dataProvider = new DefaultDataProvider();
        $dataProvider->setBaseConfig(['source' => 'tl_image_size']);

        $config = $dataProvider->getEmptyConfig();
        $config->setFields(['id', 'name', 'width', 'height']);
        $config->setSorting(['pid', 'name']);

        $collection = $dataProvider->fetchAll($config);
        if (!$collection->count()) {
            return [];
        }

        $sizes = [];
        foreach ($collection as $model) {
            $sizes[$model->getProperty('id')] = sprintf(
                '%s (%sx%s)',
                $model->getProperty('name'),
                $model->getProperty('width'),
                $model->getProperty('height')
            );
        }

        return $sizes;
    }
1185196
public function toJson() {
		$array = array("types"=>array());
		foreach ($this->types as $type) {
			$array["types"][] = $type->toJson();
		}
		if ($this->warningMessage) {
			$array["warning"] = $this->warningMessage;
		}
		return $array;
	}
918403
public function jsonSerialize() {
    return [
      'request-id'            => $this->requestId,
      'file-urls'             => $this->fileUrls,
      'original-file-size'    => $this->originalFileSize,
      'compressed-file-size'  => $this->compressedFileSize,
      'percentage-saving'     => $this->percentageSaving(),
      'compression-ratio'     => $this->compressionRatio(),
    ];
  }
969880
public function jsonDecode()
    {
        $json = json_decode($this->body, true);
        if ($json===null){
            throw new JsonFormatException($this->body);
        }
        return $json;
    }
923174
public function getSize() {
		list($this->width, $this->height) = $result = array(imagesx($this->image), imagesy($this->image));
		return $result;
	}
1279122
public function json() {
		$array = wp_array_slice_assoc( get_object_vars( $this ),
			[ 'id', 'description', 'priority', 'panel', 'options' ]
		);

		$array['title']    = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );
		$array['active']   = $this->active();
		$array['instance'] = $this->instance_number;

		return $array;
	}
771257
protected function _getTypes() {
		$handle = new File(FILE_CACHE . 'mime_types.txt', true, 0770);
		if (!$handle->exists()) {
			# create and fill: ext||type||name||img (array serialized? separated by ||?)
			$MimeTypes = TableRegistry::get('Data.MimeTypes');
			$mimeTypes = $MimeTypes->find('all', ['fields' => ['name', 'ext', 'type', 'MimeTypeImages.name', 'MimeTypeImages.ext'], 'conditions' => ['MimeTypes.active' => 1], 'contain' => ['MimeTypeImages']]);

			$content = [];
			foreach ($mimeTypes as $m) {
				$img = (!empty($m->mime_type_image['ext']) ? $m->mime_type_image['name'] . '.' . $m->mime_type_image['ext'] : '');
				$content[] = [
					'ext' => $m['ext'],
					'name' => $m['name'],
					'type' => $m['type'],
					'img' => $img,
				];
			}
			# add special types? (file not found icon, default fallback icon, generic file ext icon...)

			if (!$handle->write(serialize($content), 'w', true)) {
				throw new Exception('Write error');
			}
		} else {
			$content = $handle->read();
			if ($content === false) {
				return [];
			}
			$content = unserialize($content);
			if ($content === false || !is_array($content)) {
				return [];
			}
		}
		return $content;
	}