php - 连续 JPEG 的 SOS 参数无效

标签 php exif

我在使用 imagecreatefromjpeg 函数时遇到此错误。

Warning: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Invalid SOS parameters for sequential JPEG in C:\wamp\www\test\index.php on line 7

我研究过,使用这个命令可以很好地传递错误,效果很好。

ini_set("gd.jpeg_ignore_warning", 1);
error_reporting(E_ALL & ~E_NOTICE);

但我想知道这是怎么回事?

这里是我的图片exif数据

Array
(
    [FileName] => 1.jpg
    [FileDateTime] => 1455186386
    [FileSize] => 1364340
    [FileType] => 2
    [MimeType] => image/jpeg
    [SectionsFound] => ANY_TAG, IFD0, COMMENT, EXIF
    [COMPUTED] => Array
        (
            [html] => width="2592" height="1944"
            [Height] => 1944
            [Width] => 2592
            [IsColor] => 1
            [ByteOrderMotorola] => 0
            [ApertureFNumber] => f/1.9
            [UserComment] => 
            [UserCommentEncoding] => UNDEFINED
        )

    [ImageWidth] => 2592
    [ImageLength] => 1944
    [Make] => samsung
    [Model] => SM-G920F
    [Orientation] => 8
    [XResolution] => 72/1
    [YResolution] => 72/1
    [ResolutionUnit] => 2
    [Software] => G920FXXU3COJ1
    [DateTime] => 2016:02:10 18:48:36
    [YCbCrPositioning] => 1
    [Exif_IFD_Pointer] => 226
    [COMMENT] => Array
        (
            [0] => File written by Adobe Photoshop¨ 5.0
        )

    [ExposureTime] => 1/25
    [FNumber] => 19/10
    [ExposureProgram] => 2
    [ISOSpeedRatings] => 200
    [ExifVersion] => 0220
    [DateTimeOriginal] => 2016:02:10 18:48:36
    [DateTimeDigitized] => 2016:02:10 18:48:36
    [ShutterSpeedValue] => 464/100
    [ApertureValue] => 1851/1000
    [BrightnessValue] => 33/100
    [ExposureBiasValue] => 0/10
    [MaxApertureValue] => 1851/1000
    [MeteringMode] => 2
    [Flash] => 0
    [FocalLength] => 220/100
    [MakerNote] => 0100 Z@P
    [UserComment] => 
    [FlashPixVersion] => 0100
    [ColorSpace] => 1
    [ExifImageWidth] => 2592
    [ExifImageLength] => 1944
    [ExposureMode] => 0
    [WhiteBalance] => 0
    [FocalLengthIn35mmFilm] => 22
    [SceneCaptureType] => 0
    [ImageUniqueID] => B05LLHA01PM
)

最佳答案

你可以忽略这个错误

ini_set ('gd.jpeg_ignore_warning', 1);

(这是自 PHP 7.1 以来的默认设置,但在旧版本中不是)

参见 http://php.net/manual/en/image.configuration.php

关于php - 连续 JPEG 的 SOS 参数无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35337709/

相关文章:

php - Drupal 完整数据库限制

php - 从 exif_read_data 不支持的图像格式读取元数据

exif - 是什么导致某些 EXIF 标签不可写?

C 程序错误地读取文件

php - 如何从 EXIF 获取相机序列号?

iphone - 访问 UIImagePickerController 拍摄的图像的元数据(exif 标签)- iOS/iPhone

php - 如何包含css取决于运行环境

php - 将 Bootstrap 集成到 codeigniter

php - 简单的 PHP/MySQL 用户注册有效,但无法使用用户名登录

php - vuejs 类别和关键字过滤器