ActionScript 3的读取JPEG画质 [英] ActionScript 3 Read JPEG quality

查看:136
本文介绍了ActionScript 3的读取JPEG画质的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发图片上传对Flash 10。有没有办法读取浏览图像的JPEG质量。

I am developing image uploader for Flash 10. Is there a way to read jpeg quality of the browsed images.

推荐答案

不幸的是,它不能直接完成:

Unfortunately, it can't be done directly:

品质因数没有存储   直接在JPEG文件,所以你   不能从读取品质因数   文件。 (来源: 页...)

The quality factor is not stored directly in the JPEG file, so you cannot read the quality factor from the file. (from: Microsoft support pages...)

在更多详细信息:

所使用的量化表   以玉米preSS的图像被存储在   在JFIF头,但JPEG画质   被用于生成因子   量化表不存储沿   与图像,因此原   JPEG质量因素是丢失。 (来源:<一href="http://docs.google.com/viewer?a=v&q=cache%3aj2Zk2KXznzMJ%3awww.usenix.org/events/usits99/full_papers/chandra/chandra.pdf+%22IJG+scale%22+header&hl=en&gl=uk&pid=bl&srcid=ADGEESiUaSRAI0kIXpVSTWnBe37rAgsRzeyaVBihrP3xGzkqbs6IobNkaD104eNCfGN4cdW_revy0CvL_O3SHgXDpUfMY1cyReiOLGWxHRGgvrR8rVwJ2EHEbHkSHXyv1SjZPdBPOv87&sig=AHIEtbTxfAFq9GM5Kq9YLDWeprs6OV-xTA"相对=nofollow> JPEG的COM pression指标作为质量感知的图像转码,通过Surendar钱德拉和卡拉施拉特埃利斯)

The quantization table that was used to compress an image is stored in the JFIF header, but the JPEG Quality Factor that was used to generate the quantization table is not stored along with the image and hence the original JPEG Quality Factor is lost. (from: JPEG Compression Metrics as a Quality Aware Image Transcoding, by Surendar Chandra and Carla Schlatter Ellis)

以上报价是一份文件,其中讨论如何为估算的COM pression水平(通过检查图像中使用的量化表),但它看起来并不容易执行:有一个例子这里这是的难懂 codeBase的一部分,但它是用C写的。

The above quote is from a paper which discusses ways to estimate the level of compression (by examining the quantization tables used in the image), but it doesn't look easy to implement: there's an example here which is part of the Image Magick codebase, but it's written in C.

难懂一直移植到的 HAXE ,它可以编译成闪光code,所以可以想象你可以得到的东西的工作,但恐怕这超出了我的技能说明如何!

Image Magick has been ported to Haxe, which can be complied into Flash code, so conceivably you could get something working, but I'm afraid it's beyond my skills to explain how!

编辑:刚刚发现了一个类似的问题上的超级用户,其中还提到了难懂。

just found a similar question on SuperUser, which also mentions Image Magick.

编辑:您可能也有兴趣在回答这个问题,它询问如何获取图像的大小,而无需加载整个文件(有利于处理图像大于闪存可以处理)。

you might also be interested in the answers to this question, which asked how to get the size of an image without loading the whole file (good for dealing with images bigger than Flash can handle).

这篇关于ActionScript 3的读取JPEG画质的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆