硬汉嵌入式论坛

 找回密码
 立即注册
查看: 4781|回复: 1
收起左侧

[LibJPEG] 【LibJPEG专题系列十六】其他常见的兼容性问题

[复制链接]

740

主题

1326

回帖

3546

积分

管理员

春暖花开

Rank: 9Rank: 9Rank: 9

积分
3546
QQ
发表于 2015-5-9 15:49:19 | 显示全部楼层 |阅读模式
                            Section - [16] What other common
                             compatibility problems are there?

Aside from the file format difficulties mentioned in the previous section, there are a few other common
causes of trouble with transferring JPEGs.


Old decoders that don't handle progressive JPEG will often give rather cryptic error messages when fed
a progressive JPEG.  If you get a complaint like "Unsupported marker type 0xC2", then you definitely
have a progressive JPEG file and a non-progressive-capable decoder.  (See part 2 of this FAQ for infor-
mation about more up-to-date programs.)  Or you may get a generic error message that claims the file is
corrupted or isn't JPEG at all.


Adobe Photoshop and some other prepress-oriented applications will produce four-channel CMYK JPEG
files when asked to save a JPEG from CMYK image mode. Hardly anything that's not prepress-savvy
will cope with CMYK JPEGs (or any other CMYK format for that matter).  When making JPEGs for Web
use, be sure to save from RGB or grayscale mode.


Photoshop also has a habit of stuffing a rather large thumbnail/preview image into an application-private
segment of JPEG files.  Some other applications (notably early releases of Sun's Java library) are known
to choke on this data.  This is definitely a bug in those other applications, but the best available workar-
ound is still to tell Photoshop not to save a thumbnail.  If you're putting up an image on the Web, having a
thumbnail embedded in it is just a waste of download time anyway.


When transferring images between machines running different operating systems, be very careful to get
a straight "binary" transfer --- any sort of text format conversion will corrupt a JPEG file.  Actually that's
true for all image formats not just JPEG.
努力打造安富莱高质量微信公众号:点击扫描图片关注
回复

使用道具 举报

740

主题

1326

回帖

3546

积分

管理员

春暖花开

Rank: 9Rank: 9Rank: 9

积分
3546
QQ
 楼主| 发表于 2015-5-9 15:51:37 | 显示全部楼层
              Section 16—其他常见的兼容性问题

除了上一节提到关于文件格式的困难,还有一些关于JPEG文件传输的其他常见问题。


不处理渐进式JPEG的旧解码器在遇到此类JPEG时经常会出现含义相当模糊的错误信息。如果你得到一个
Unsupported marker type 0xC2”这样的答复,很明显,这是一个渐进式JPEG文件以及一个不能逐行
处理的解码器。(更多更新的信息,见Part 2)抑或这只是个一般性的错误信息:文件已被损坏又或者该
文件根本就不是JPEG文件。


当问及从CMYK图像模式中保存JPEG文件时,Adobe Photoshop和其他一些定位于印前的应用,将会产生
四通道的CMYK JPEG文件。几乎没有任何印前不娴熟的软件能处理此类CMYK JPEG文件(或与此有关的
任何CMYK格式)。JPEG文件将用于Web使用时,务必保证其存储为RGB或灰度模式。


Photoshop还有这样一个习惯:将一个相当大的缩略图/预览图像放进JPEG文件的专有应用程序段。一些其
他的应用(特别是早期的Sun公司Java库的版本)被这一数据所阻止。在那些其他应用程序中,这绝对是
个错误,但可用的最好的解决办法就是不用Photoshop保存缩略图。如果你将图像放到网站上,其内嵌有
缩略图不管怎样都只是浪费下载时间。


在运行不同操作系统的机器之间传输图像时,必须要非常小心来获取直接的“二进制”传输——任何形式
的文本格式转换将会损坏的JPEG文件。当然,这适用于所有图像格式,而不单单指JPEG
努力打造安富莱高质量微信公众号:点击扫描图片关注
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2024-5-12 06:19 , Processed in 0.151650 second(s), 25 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表