将EXIF / JPG缩略图添加到jpg

编程入门 行业动态 更新时间:2024-10-10 03:27:17
本文介绍了将EXIF / JPG缩略图添加到jpg的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想我可以解决大多数问题,但是这个问题正在踢我的屁股。 更糟糕的是,我知道我不可能是第一个想要为jpg添加缩略图但尚未拥有的人。我在很多其他应用程序中看到它。然而,尽管非常接近,我似乎无法使它工作。 我知道问题必须在于我如何制作缩略图的PropertyItem - 因为如果我注释掉第24-34行,JPG保存得很好,没有内置缩略图。 所以我要么在第8-14行之间错误,我将位图NewThumbnail转换为一个字节数组,或者我在制作缩略图属性方面我错了。 但对于我的生活,我似乎无法解决这个问题。 非常感谢任何帮助。

I''d like to think I can work out most issues, but this one is kicking my butt. What''s worse, is that I know I can''t be the first guy to want to add a thumbnail to jpg that doesn''t already have one. I see it in plenty of other applications. Yet I can''t seem to make it work despite being so very close. I know the problem has to be in how I am making the PropertyItem of the thumbnail - because if I comment out lines 24-34 the JPG saves fine, just without a built-in thumbnail. So I''m either wrong between lines 8-14 where I convert the bitmap NewThumbnail into a byte array, or I''m wrong in how I''m making the thumbnail property. But for the life of me I can''t seem to work it out. Any assistance in this would be greatly appreciated.

展开 | 选择 | 换行 | 行号 推荐答案

我从来没能过修改/添加PropertyItems到.NET中的位图 我只是想在前几天询问是否有人知道如何。 我总是得到GDI +错误。 /> 特别是缩略图我觉得很有趣,因为我有一些缩略图与实际图像无关的图像。这让人非常困惑。 只是查看常数,我认为你需要提供更多的缩略图数据: (来自我的ENUM) I have never been able to modify/add PropertyItems to a Bitmap in .NET I was just thinking about asking the other day if anyone knew how. I always get the GDI+ error. The thumbnail thing in particular I find interesting as I have some images whos thumbnails have no relation to the actual image. Which makes it very confusing. Just looked up the constants, I think you need to supply more then just thumbnail data: (From my ENUM) 展开 | 选择 | Wrap | 行号

只是查看常量,我想你需要提供更多的缩略图数据: (来自我的ENUM) Just looked up the constants, I think you need to supply more then just thumbnail data: (From my ENUM)

是的...我有点试图埋葬我的关于所有这些问题,请大家谈谈。 我知道很多都是可选的,就像它们是选择一样在主要图像中,EXIF是其中的一部分。 EquipMake,EquipModel,Artist等。 因为我可以阅读exif缩略图而无需查找任何其他属性,我希望能够在没有任何属性的情况下编写它其他属性。 属性20507(0x501B)是ThumnailData,这是我用来获取EXIF缩略图的全部内容。 嗯......我只是出于想法。我想我会离开这个问题一天然后再攻击它。

Yeah... I was kinda trying to bury my head in the sand about all of those. I know many are optional, just as they are optional in the primary image the EXIF is a part of. EquipMake, EquipModel, Artist and so on. Since I can read an exif thumbnail without having to look up any of the other properties I was expecting to be able to write it without any of the other properties. Property 20507 (0x501B) is ThumnailData, which is all I use to get the EXIF thumbnail. Hmm... I''m just out of ideas. I guess I''ll walk away from this issue for a day then attack it fresh.

你可能能够读取thumbnailData中的byte [],但其他东西必须去要知道重建位图的尺寸吗? Well you might be able to read the byte[] in thumbnailData, but something else has to go on to know the dimensions of the bitmap for reconstruction right?

更多推荐

将EXIF / JPG缩略图添加到jpg

本文发布于:2023-08-06 11:27:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1311968.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:缩略图   EXIF   JPG   jpg

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!