读取JPG图片的Exif属性(二) - C代码实现

来源:互联网 发布:情头软件即刻 编辑:程序博客网 时间:2024/05/29 12:06

读区Exif属性简介

        读取Exif基本上就是在懂得Exif的格式的基础上,详细见上文: 

读取JPG图片的Exif属性 - Exif信息简介

然后就是对图片的数据进行字节分析了。这个分析也是非常重要的,就是一个一个字节来分析图片的Exif属性,一般这段字节就是图片的开始部分。可以使用 工具将JPG图片按照16进制的格式打开,然后在对着图片来分析。

        由于国内关于此部分的讲述非常少,我在国外的一个网站上找到一个简单的读取Exif属性的实例,下面就是关于这个demo自己做的一些修改和理解。

如下是一个实际图片的16进制数据:
FF D8 FF E0 00 10 4A 46 49 46 00 01 02 01 00 60
00 60   00 00 FF E1 08 32 45 78 69 66 00 00 49 49

 DecodeExif函数主要是获取到Eixf属性在图片数据中入口地址:

第一次执行DecodeExif 中的for(;;)读取的是section FF E0M_JFIF
 FF D8       SOI
 FF E0       APP0
 00 10      APP0 LENGTH = 16

FF D8 FF E0 00 10 4A 46 49 46 00 01 02 01 00 60
00 60   00 00 FF E1 08 32 45 78 69 66 00 00 49 49
蓝色部分就是读取的长度16个字节。

第二次次执行DecodeExif 中的for(;;)读取的是section FF E0M_JFIF

FF D8 FF E0 00 10 4A 46 49 46 00 01 02 01 00 60
00 60   00 00 FF E1 08 32 45 78 69 66 00 00 49 49

FF E1      APP1
 08 32     APP0 LENGTH = 08 32 = 2098
45 78 69 66   "Exif" 字符 
也就是代码:if(memcmp(Data+2,"Exif",4)==0)所定义那样,获取四个字符,
从FF E1开始 长度为2098 个字节。
m_exifinfo->IsExif= process_EXIF((unsignedchar*)Data+2, itemlen);
从这个函数开始,分析Exif各种属性,也就是获取到Eixf属性在图片数据中入口地址以及Exif所占的长度
  1. bool Cexif::DecodeExif(FILE * hFile)
  2. {
  3. int a;
  4. int HaveCom = 0;
  5. a = fgetc(hFile);
  6. if (a != 0xff || fgetc(hFile) != M_SOI){
  7. return 0;
  8. }
  9. for(;;){
  10. int itemlen;
  11. int marker = 0;
  12. int ll,lh, got;
  13. unsigned char * Data;
  14. if (SectionsRead >= MAX_SECTIONS){
  15. strcpy(m_szLastError,"Too many sections in jpg file");
  16. return 0;
  17. }
  18. for (a=0;a<7;a++){
  19. marker = fgetc(hFile);
  20. if (marker != 0xff) break;
  21. if (a >= 6){
  22. printf("too many padding unsigned chars\n");
  23. return 0;
  24. }
  25. }
  26. if (marker == 0xff){
  27. // 0xff is legal padding, but if we get that many, something's wrong.
  28. strcpy(m_szLastError,"too many padding unsigned chars!");
  29. return 0;
  30. }
  31. Sections[SectionsRead].Type = marker;
  32. // Read the length of the section.
  33. lh = fgetc(hFile);
  34. ll = fgetc(hFile);
  35. itemlen = (lh << 8) | ll;
  36. if (itemlen < 2){
  37. strcpy(m_szLastError,"invalid marker");
  38. return 0;
  39. }
  40. Sections[SectionsRead].Size = itemlen;
  41. Data = (unsigned char *)malloc(itemlen);
  42. if (Data == NULL){
  43. strcpy(m_szLastError,"Could not allocate memory");
  44. return 0;
  45. }
  46. Sections[SectionsRead].Data = Data;
  47. // Store first two pre-read unsigned chars.
  48. Data[0] = (unsigned char)lh;
  49. Data[1] = (unsigned char)ll;
  50. got = fread(Data+2, 1, itemlen-2,hFile); // Read the whole section.
  51. if (got != itemlen-2){
  52. strcpy(m_szLastError,"Premature end of file?");
  53. return 0;
  54. }
  55. SectionsRead += 1;
  56. switch(marker){
  57. case M_SOS: // stop before hitting compressed data
  58. // If reading entire image is requested, read the rest of the data.
  59. /*if (ReadMode & READ_IMAGE){
  60. int cp, ep, size;
  61. // Determine how much file is left.
  62. cp = ftell(infile);
  63. fseek(infile, 0, SEEK_END);
  64. ep = ftell(infile);
  65. fseek(infile, cp, SEEK_SET);
  66. size = ep-cp;
  67. Data = (uchar *)malloc(size);
  68. if (Data == NULL){
  69. strcpy(m_szLastError,"could not allocate data for entire image");
  70. return 0;
  71. }
  72. got = fread(Data, 1, size, infile);
  73. if (got != size){
  74. strcpy(m_szLastError,"could not read the rest of the image");
  75. return 0;
  76. }
  77. Sections[SectionsRead].Data = Data;
  78. Sections[SectionsRead].Size = size;
  79. Sections[SectionsRead].Type = PSEUDO_IMAGE_MARKER;
  80. SectionsRead ++;
  81. HaveAll = 1;
  82. }*/
  83. return 1;
  84. case M_EOI: // in case it's a tables-only JPEG stream
  85. printf("No image in jpeg!\n");
  86. return 0;
  87. case M_COM: // Comment section
  88. if (HaveCom){
  89. // Discard this section.
  90. free(Sections[--SectionsRead].Data);
  91. Sections[SectionsRead].Data=0;
  92. }else{
  93. process_COM(Data, itemlen);
  94. HaveCom = 1;
  95. }
  96. break;
  97. case M_JFIF:
  98. // Regular jpegs always have this tag, exif images have the exif
  99. // marker instead, althogh ACDsee will write images with both markers.
  100. // this program will re-create this marker on absence of exif marker.
  101. // hence no need to keep the copy from the file.
  102. free(Sections[--SectionsRead].Data);
  103. Sections[SectionsRead].Data=0;
  104. break;
  105. case M_EXIF:
  106. // Seen files from some 'U-lead' software with Vivitar scanner
  107. // that uses marker 31 for non exif stuff. Thus make sure
  108. // it says 'Exif' in the section before treating it as exif.
  109. if (memcmp(Data+2, "Exif", 4) == 0){
  110. m_exifinfo->IsExif = process_EXIF((unsigned char *)Data+2, itemlen);
  111. }else{
  112. // Discard this section.
  113. free(Sections[--SectionsRead].Data);
  114. Sections[SectionsRead].Data=0;
  115. }
  116. break;
  117. case M_SOF0:
  118. case M_SOF1:
  119. case M_SOF2:
  120. case M_SOF3:
  121. case M_SOF5:
  122. case M_SOF6:
  123. case M_SOF7:
  124. case M_SOF9:
  125. case M_SOF10:
  126. case M_SOF11:
  127. case M_SOF13:
  128. case M_SOF14:
  129. case M_SOF15:
  130. process_SOFn(Data, marker);
  131. break;
  132. default:
  133. // Skip any other sections.
  134. //if (ShowTags) printf("Jpeg section marker 0x%02x size %d\n",marker, itemlen);
  135. break;
  136. }
  137. }
  138. return 1;
  139. }

粗略分析Exif属性

FF D8 FF E0 00 10 4A 46 49 46 00 01 02 01 00 60
00 60   00 00 FF E1 08 32 45 78 69 66 00 00 49 49
2A 00 08 00 00 00   0B 00 0F 01 02 00 05 00 00 00
A2 00 00 00 10 01   02 00 20 00 00 00 A8 00 00 00
process_EXIF 
主要是对Exif属性做一个前期的处理,为了进一步详细的分析做处理。
由于EXIF是一种可交换的文件格式,所以可以用在Intel系列和Motorola系列的CPU上(至于两者CPU的区别,大家可以到网上找找,这里不做说明)。在文件中有一个标志,如果是“MM”表示Motorola的CPU,否则为“II”表示Intel的CPU。
 49 49  表示的是小端,小端的时候要格外注意其取字符的时候是从后往前取,才能获得正确的数据。
 4D 4D  表示的是大端
2A 00 表示的是检查下面 2 个字节是否是 0x2A00
08 00 00 00 判断下面的 0th IFD Offset 是否是 0x08000000

  1. ////////////////////////////////////////////////////////////////////////////////
  2. /*--------------------------------------------------------------------------
  3. Process a EXIF marker
  4. Describes all the drivel that most digital cameras include...
  5. --------------------------------------------------------------------------*/
  6. bool Cexif::process_EXIF(unsigned char * CharBuf, unsigned int length)
  7. {
  8. m_exifinfo->FlashUsed = 0;
  9. /* If it's from a digicam, and it used flash, it says so. */
  10. m_exifinfo->Comments[0] = '\0'; /* Initial value - null string */
  11. ExifImageWidth = 0;
  12. { /* Check the EXIF header component */
  13. static const unsigned char ExifHeader[] = "Exif\0\0";
  14. if (memcmp(CharBuf+0, ExifHeader,6)){
  15. strcpy(m_szLastError,"Incorrect Exif header");
  16. return 0;
  17. }
  18. }
  19. if (memcmp(CharBuf+6,"II",2) == 0){
  20. MotorolaOrder = 0;
  21. }else{
  22. if (memcmp(CharBuf+6,"MM",2) == 0){
  23. MotorolaOrder = 1;
  24. }else{
  25. strcpy(m_szLastError,"Invalid Exif alignment marker.");
  26. return 0;
  27. }
  28. }
  29. /* Check the next two values for correctness. */
  30. if (Get16u(CharBuf+8) != 0x2a){
  31. strcpy(m_szLastError,"Invalid Exif start (1)");
  32. return 0;
  33. }
  34. int FirstOffset = Get32u(CharBuf+10);
  35. if (FirstOffset < 8 || FirstOffset > 16){
  36. // I used to ensure this was set to 8 (website I used indicated its 8)
  37. // but PENTAX Optio 230 has it set differently, and uses it as offset. (Sept 11 2002)
  38. strcpy(m_szLastError,"Suspicious offset of first IFD value");
  39. return 0;
  40. }
  41. unsigned char * LastExifRefd = CharBuf;
  42. /* First directory starts 16 unsigned chars in. Offsets start at 8 unsigned chars in. */
  43. if (!ProcessExifDir(CharBuf+14, CharBuf+6, length-6, m_exifinfo, &LastExifRefd))
  44. return 0;
  45. /* This is how far the interesting (non thumbnail) part of the exif went. */
  46. // int ExifSettingsLength = LastExifRefd - CharBuf;
  47. /* Compute the CCD width, in milimeters. */
  48. if (m_exifinfo->FocalplaneXRes != 0){
  49. m_exifinfo->CCDWidth = (float)(ExifImageWidth * m_exifinfo->FocalplaneUnits / m_exifinfo->FocalplaneXRes);
  50. }
  51. return 1;
  52. }

详细分析Exif属性

FF D8 FF E0 00 10 4A 46 49 46 00 01 02 01 00 60
00 60   00 00 FF E1 08 32 45 78 69 66 00 00 49 49
2A 00 08 00 00 00   0B 00 0F 01 02 00 05 00 00 00
A2 00 00 00 10 01   02 00 20 00 00 00 A8 00 00 00

0B 00  Tag总共的数量,12个, 00 0B, 所以下面就主要围绕这个12个tag来寻找其属性
一个tag的格式就是:
Tag 类型名
Format: 格式,tag TYPE
count:   最多的字符个数为
offset: 偏移量,但是这里的偏移量要记得加上从(II  49 49)+1D

按照第一个实例:

                                           0F 01 02 00 05 00 00 00
A2 00 00 00 10 01   02 00 20 00 00 00 A8 00 00 00

Tag  0F 01     TAG Image input equipment manuf 
Format: 格式, 02 00, 格式为2
count:   05 00 00 00  为5
offset: 偏移量,A2 00 00 00 +1D  ,需要移动到 C0
*LastExifRefdP=ValuePtr+BytesCount;获取获得数据的 46 4C 49 52  

一次类推获得相关的tag数据,都是这样获得。关于GPS信息的话,且听下回分解。
  1. /*--------------------------------------------------------------------------
  2. Process one of the nested EXIF directories.
  3. --------------------------------------------------------------------------*/
  4. bool Cexif::ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBase, unsigned ExifLength,
  5. EXIFINFO * const m_exifinfo, unsigned char ** const LastExifRefdP )
  6. {
  7. int de;
  8. int a;
  9. int NumDirEntries;
  10. unsigned ThumbnailOffset = 0;
  11. unsigned ThumbnailSize = 0;
  12. NumDirEntries = Get16u(DirStart);
  13. if ((DirStart+2+NumDirEntries*12) > (OffsetBase+ExifLength)){
  14. strcpy(m_szLastError,"Illegally sized directory");
  15. return 0;
  16. }
  17. for (de=0;de<NumDirEntries;de++){
  18. int Tag, Format, Components;
  19. unsigned char * ValuePtr;
  20. /* This actually can point to a variety of things; it must be
  21. cast to other types when used. But we use it as a unsigned char-by-unsigned char
  22. cursor, so we declare it as a pointer to a generic unsigned char here.
  23. */
  24. int BytesCount;
  25. unsigned char * DirEntry;
  26. DirEntry = DirStart+2+12*de;
  27. Tag = Get16u(DirEntry);
  28. Format = Get16u(DirEntry+2);
  29. Components = Get32u(DirEntry+4);
  30. if ((Format-1) >= NUM_FORMATS) {
  31. /* (-1) catches illegal zero case as unsigned underflows to positive large */
  32. strcpy(m_szLastError,"Illegal format code in EXIF dir");
  33. return 0;
  34. }
  35. BytesCount = Components * BytesPerFormat[Format];
  36. if (BytesCount > 4){
  37. unsigned OffsetVal;
  38. OffsetVal = Get32u(DirEntry+8);
  39. /* If its bigger than 4 unsigned chars, the dir entry contains an offset.*/
  40. if (OffsetVal+BytesCount > ExifLength){
  41. /* Bogus pointer offset and / or unsigned charcount value */
  42. strcpy(m_szLastError,"Illegal pointer offset value in EXIF.");
  43. return 0;
  44. }
  45. ValuePtr = OffsetBase+OffsetVal;
  46. }else{
  47. /* 4 unsigned chars or less and value is in the dir entry itself */
  48. ValuePtr = DirEntry+8;
  49. }
  50. if (*LastExifRefdP < ValuePtr+BytesCount){
  51. /* Keep track of last unsigned char in the exif header that was
  52. actually referenced. That way, we know where the
  53. discardable thumbnail data begins.
  54. */
  55. *LastExifRefdP = ValuePtr+BytesCount;
  56. }
  57. /* Extract useful components of tag */
  58. switch(Tag){
  59. case TAG_MAKE:
  60. strncpy(m_exifinfo->CameraMake, (char*)ValuePtr, 31);
  61. break;
  62. case TAG_MODEL:
  63. strncpy(m_exifinfo->CameraModel, (char*)ValuePtr, 39);
  64. break;
  65. case TAG_EXIF_VERSION:
  66. strncpy(m_exifinfo->Version,(char*)ValuePtr, 4);
  67. break;
  68. case TAG_DATETIME_ORIGINAL:
  69. strncpy(m_exifinfo->DateTime, (char*)ValuePtr, 19);
  70. break;
  71. case TAG_USERCOMMENT:
  72. // Olympus has this padded with trailing spaces. Remove these first.
  73. for (a=BytesCount;;){
  74. a--;
  75. if (((char*)ValuePtr)[a] == ' '){
  76. ((char*)ValuePtr)[a] = '\0';
  77. }else{
  78. break;
  79. }
  80. if (a == 0) break;
  81. }
  82. /* Copy the comment */
  83. if (memcmp(ValuePtr, "ASCII",5) == 0){
  84. for (a=5;a<10;a++){
  85. char c;
  86. c = ((char*)ValuePtr)[a];
  87. if (c != '\0' && c != ' '){
  88. strncpy(m_exifinfo->Comments, (char*)ValuePtr+a, 199);
  89. break;
  90. }
  91. }
  92. }else{
  93. strncpy(m_exifinfo->Comments, (char*)ValuePtr, 199);
  94. }
  95. break;
  96. case TAG_FNUMBER:
  97. /* Simplest way of expressing aperture, so I trust it the most.
  98. (overwrite previously computd value if there is one)
  99. */
  100. m_exifinfo->ApertureFNumber = (float)ConvertAnyFormat(ValuePtr, Format);
  101. break;
  102. case TAG_APERTURE:
  103. case TAG_MAXAPERTURE:
  104. /* More relevant info always comes earlier, so only
  105. use this field if we don't have appropriate aperture
  106. information yet.
  107. */
  108. if (m_exifinfo->ApertureFNumber == 0){
  109. m_exifinfo->ApertureFNumber = (float)exp(ConvertAnyFormat(ValuePtr, Format)*log(2)*0.5);
  110. }
  111. break;
  112. case TAG_BRIGHTNESS:
  113. m_exifinfo->Brightness = (float)ConvertAnyFormat(ValuePtr, Format);
  114. break;
  115. case TAG_FOCALLENGTH:
  116. /* Nice digital cameras actually save the focal length
  117. as a function of how farthey are zoomed in.
  118. */
  119. m_exifinfo->FocalLength = (float)ConvertAnyFormat(ValuePtr, Format);
  120. break;
  121. case TAG_SUBJECT_DISTANCE:
  122. /* Inidcates the distacne the autofocus camera is focused to.
  123. Tends to be less accurate as distance increases.
  124. */
  125. m_exifinfo->Distance = (float)ConvertAnyFormat(ValuePtr, Format);
  126. break;
  127. case TAG_EXPOSURETIME:
  128. /* Simplest way of expressing exposure time, so I
  129. trust it most. (overwrite previously computd value
  130. if there is one)
  131. */
  132. m_exifinfo->ExposureTime =
  133. (float)ConvertAnyFormat(ValuePtr, Format);
  134. break;
  135. case TAG_SHUTTERSPEED:
  136. /* More complicated way of expressing exposure time,
  137. so only use this value if we don't already have it
  138. from somewhere else.
  139. */
  140. if (m_exifinfo->ExposureTime == 0){
  141. m_exifinfo->ExposureTime = (float)
  142. (1/exp(ConvertAnyFormat(ValuePtr, Format)*log(2)));
  143. }
  144. break;
  145. case TAG_FLASH:
  146. if ((int)ConvertAnyFormat(ValuePtr, Format) & 7){
  147. m_exifinfo->FlashUsed = 1;
  148. }else{
  149. m_exifinfo->FlashUsed = 0;
  150. }
  151. break;
  152. case TAG_ORIENTATION:
  153. m_exifinfo->Orientation = (int)ConvertAnyFormat(ValuePtr, Format);
  154. if (m_exifinfo->Orientation < 1 || m_exifinfo->Orientation > 8){
  155. strcpy(m_szLastError,"Undefined rotation value");
  156. m_exifinfo->Orientation = 0;
  157. }
  158. break;
  159. case TAG_EXIF_IMAGELENGTH:
  160. case TAG_EXIF_IMAGEWIDTH:
  161. /* Use largest of height and width to deal with images
  162. that have been rotated to portrait format.
  163. */
  164. a = (int)ConvertAnyFormat(ValuePtr, Format);
  165. if (ExifImageWidth < a) ExifImageWidth = a;
  166. break;
  167. case TAG_FOCALPLANEXRES:
  168. m_exifinfo->FocalplaneXRes = (float)ConvertAnyFormat(ValuePtr, Format);
  169. break;
  170. case TAG_FOCALPLANEYRES:
  171. m_exifinfo->FocalplaneYRes = (float)ConvertAnyFormat(ValuePtr, Format);
  172. break;
  173. case TAG_RESOLUTIONUNIT:
  174. switch((int)ConvertAnyFormat(ValuePtr, Format)){
  175. case 1: m_exifinfo->ResolutionUnit = 1.0f; break; /* 1 inch */
  176. case 2:m_exifinfo->ResolutionUnit = 1.0f; break;
  177. case 3: m_exifinfo->ResolutionUnit = 0.3937007874f; break; /* 1 centimeter*/
  178. case 4: m_exifinfo->ResolutionUnit = 0.03937007874f; break; /* 1 millimeter*/
  179. case 5: m_exifinfo->ResolutionUnit = 0.00003937007874f; /* 1 micrometer*/
  180. }
  181. break;
  182. case TAG_FOCALPLANEUNITS:
  183. switch((int)ConvertAnyFormat(ValuePtr, Format)){
  184. case 1: m_exifinfo->FocalplaneUnits = 1.0f; break; /* 1 inch */
  185. case 2:m_exifinfo->FocalplaneUnits = 1.0f; break;
  186. case 3: m_exifinfo->FocalplaneUnits = 0.3937007874f; break; /* 1 centimeter*/
  187. case 4: m_exifinfo->FocalplaneUnits = 0.03937007874f; break; /* 1 millimeter*/
  188. case 5: m_exifinfo->FocalplaneUnits = 0.00003937007874f; /* 1 micrometer*/
  189. }
  190. break;
  191. // Remaining cases contributed by: Volker C. Schoech <schoech(at)gmx(dot)de>
  192. case TAG_EXPOSURE_BIAS:
  193. m_exifinfo->ExposureBias = (float) ConvertAnyFormat(ValuePtr, Format);
  194. break;
  195. case TAG_WHITEBALANCE:
  196. m_exifinfo->Whitebalance = (int)ConvertAnyFormat(ValuePtr, Format);
  197. break;
  198. case TAG_METERING_MODE:
  199. m_exifinfo->MeteringMode = (int)ConvertAnyFormat(ValuePtr, Format);
  200. break;
  201. case TAG_EXPOSURE_PROGRAM:
  202. m_exifinfo->ExposureProgram = (int)ConvertAnyFormat(ValuePtr, Format);
  203. break;
  204. case TAG_ISO_EQUIVALENT:
  205. m_exifinfo->ISOequivalent = (int)ConvertAnyFormat(ValuePtr, Format);
  206. if ( m_exifinfo->ISOequivalent < 50 ) m_exifinfo->ISOequivalent *= 200;
  207. break;
  208. case TAG_COMPRESSION_LEVEL:
  209. m_exifinfo->CompressionLevel = (int)ConvertAnyFormat(ValuePtr, Format);
  210. break;
  211. case TAG_XRESOLUTION:
  212. m_exifinfo->Xresolution = (float)ConvertAnyFormat(ValuePtr, Format);
  213. break;
  214. case TAG_YRESOLUTION:
  215. m_exifinfo->Yresolution = (float)ConvertAnyFormat(ValuePtr, Format);
  216. break;
  217. case TAG_THUMBNAIL_OFFSET:
  218. ThumbnailOffset = (unsigned)ConvertAnyFormat(ValuePtr, Format);
  219. break;
  220. case TAG_THUMBNAIL_LENGTH:
  221. ThumbnailSize = (unsigned)ConvertAnyFormat(ValuePtr, Format);
  222. break;
  223. }
  224. if (Tag == TAG_EXIF_OFFSET || Tag == TAG_INTEROP_OFFSET){
  225. unsigned char * SubdirStart;
  226. SubdirStart = OffsetBase + Get32u(ValuePtr);
  227. if (SubdirStart < OffsetBase ||
  228. SubdirStart > OffsetBase+ExifLength){
  229. strcpy(m_szLastError,"Illegal subdirectory link");
  230. return 0;
  231. }
  232. ProcessExifDir(SubdirStart, OffsetBase, ExifLength, m_exifinfo, LastExifRefdP);
  233. continue;
  234. }
  235. }
  236. {
  237. /* In addition to linking to subdirectories via exif tags,
  238. there's also a potential link to another directory at the end
  239. of each directory. This has got to be the result of a
  240. committee!
  241. */
  242. unsigned char * SubdirStart;
  243. unsigned Offset;
  244. Offset = Get16u(DirStart+2+12*NumDirEntries);
  245. if (Offset){
  246. SubdirStart = OffsetBase + Offset;
  247. if (SubdirStart < OffsetBase
  248. || SubdirStart > OffsetBase+ExifLength){
  249. strcpy(m_szLastError,"Illegal subdirectory link");
  250. return 0;
  251. }
  252. ProcessExifDir(SubdirStart, OffsetBase, ExifLength, m_exifinfo, LastExifRefdP);
  253. }
  254. }
  255. if (ThumbnailSize && ThumbnailOffset){
  256. if (ThumbnailSize + ThumbnailOffset <= ExifLength){
  257. /* The thumbnail pointer appears to be valid. Store it. */
  258. m_exifinfo->ThumbnailPointer = OffsetBase + ThumbnailOffset;
  259. m_exifinfo->ThumbnailSize = ThumbnailSize;
  260. }
  261. }
  262. return 1;
  263. }

Demo最终实现的结果


参考文档

http://blog.csdn.net/fioletfly/article/details/53605959
http://blog.csdn.net/xuan_oscar/article/details/2449624





0 1
原创粉丝点击