easygithdev/imgmeta 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

easygithdev/imgmeta

Composer 安装命令:

composer require easygithdev/imgmeta

包简介

Wrapper to access Exif and IPTC data from an image

README 文档

README

Wrapper to access Exif and IPTC data from an image.

Installing

Installation is quite typical - with composer:

composer require easygithdev/imgmeta

How to use

Include the autoload, if you need.

<?php

require 'vendor/autoload.php';

use ImgMeta\ImgData;

Define a stream. The stream is a file, a base64 string or an Url :

$stream = 'image.jpg';
$stream = 'data:image/jpeg;base64,iVBOR....';
$stream = 'http://domain/image.jpg';

Accessing to all the metas like this :

$imgData = new ImgData();
$metas = $imgData->read($stream)->getMetas();

Fetching the EXIF or IPTC tags :

$imgData->read($stream)->getExif()->fetch(ExifTags::Copyright);
$imgData->read($stream)->getIptc()->fetch(IptcTags::City);

Or you can use the quick acces :

(new ImgData())->read($stream)->exif('Copyright');
(new ImgData())->read($stream)->iptc('City');

Working with EXIF only

Get all the datas :

$imgData = new ImgData();
$exifManager = $imgData->createExifManager();
$exifManager->read(ExifReader::getReader($stream));
$exifManager->getMetas();

Fetch one tag :

$exifManager->fetch(ExifTags::Copyright);

Or :

$exifManager->fetch('Copyright');

For example to fetch the GPS informations :

$latitude = $exifManager->fetch('GPSLatitude');
$longitude = $exifManager->fetch('GPSLongitude');

Using helper to get the GPS infos :

$exifManager->getPosition();

Working with IPTC only

$imgData = new ImgData();
$iptcManager = $imgData->createIptcManager();
$iptcManager->read(IptcReader::getReader($stream));

Get IPTC default format :

$iptcManager->getMetas();

Get IPTC by Key :

$iptcManager->getMetasByKey();

Get IPTC by Name :

$iptcManager->getMetasByName();

Get IPTC by name with all keys :

$iptcManager->getAssocMetas(IptcManager::META_BY_NAME, true);

Fetch one tag, datas are flatten :

$iptcManager->fetch(IptcTags::Country_PrimaryLocationName);

Fetch one tag, datas are originals :

$iptcManager->fetchAll(IptcTags::Country_PrimaryLocationName);

License

This project is licensed under GNU license - see the LICENSE file for deta

统计信息

  • 总下载量: 75
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2020-06-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固