裁剪JPG而不将所有内容加载到内存中 [英] Cropping a JPG without loading all of it in memory

查看:112
本文介绍了裁剪JPG而不将所有内容加载到内存中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何裁剪大型JPG并提取一小部分?
问题是主要的JPG是如此之大,我无法将所有内容加载到内存中。
我使用了ImageMagick的convert.exe,但它在所有版本的Windows上都没有正常工作,我更喜欢一些C#方法而不是一个独立的exe。

How can I crop a big JPG and extract a small portion of it? The problem is main JPGs are so big and I can't load all of it in memory. I used convert.exe from ImageMagick, but it's not working properly on all versions of windows and I prefer some C# method instead of a standalone exe.

推荐答案

我找到了一个不依赖于外部库的命令行解决方案, jpegtran

I found a command line solution which does not depend on external libraries, jpegtran.

你可以拥有主exe旁边的 jpegtran.exe 并使用以下参数调用它:

You can have jpegtran.exe beside your main exe and call it with these parameters:

jpegtran -crop WxH+X+Y input_file output_file

从这里下载 jpegtran
http://jpegclub.org/jpegtran/

这篇关于裁剪JPG而不将所有内容加载到内存中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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