Changeset 769 for trunk/src/plugins/imageformats
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/plugins/imageformats/ico/qicohandler.cpp
r651 r769 54 54 #include <QtCore/QFile> 55 55 #include <QtCore/QBuffer> 56 #include <qvariant.h> 56 57 // These next two structs represent how the icon information is stored 57 58 // in an ICO file. … … 773 774 } 774 775 776 QVariant QtIcoHandler::option(ImageOption option) const 777 { 778 if (option == Size) { 779 QIODevice *device = QImageIOHandler::device(); 780 qint64 oldPos = device->pos(); 781 ICONDIRENTRY iconEntry; 782 if (device->seek(oldPos + ICONDIR_SIZE + (m_currentIconIndex * ICONDIRENTRY_SIZE))) { 783 if (readIconDirEntry(device, &iconEntry)) { 784 device->seek(oldPos); 785 return QSize(iconEntry.bWidth, iconEntry.bHeight); 786 } 787 } 788 if (!device->isSequential()) 789 device->seek(oldPos); 790 } 791 return QVariant(); 792 } 793 794 bool QtIcoHandler::supportsOption(ImageOption option) const 795 { 796 return option == Size; 797 } 798 775 799 /*! 776 800 * Verifies if some values (magic bytes) are set as expected in the header of the file. -
trunk/src/plugins/imageformats/ico/qicohandler.h
r651 r769 63 63 static bool canRead(QIODevice *device); 64 64 65 bool supportsOption(ImageOption option) const; 66 QVariant option(ImageOption option) const; 67 65 68 private: 66 69 int m_currentIconIndex; -
trunk/src/plugins/imageformats/jpeg/qjpeghandler.cpp
r651 r769 1189 1189 } 1190 1190 1191 return device->peek(2) == "\xFF\xD8"; 1191 char buffer[2]; 1192 if (device->peek(buffer, 2) != 2) 1193 return false; 1194 1195 return uchar(buffer[0]) == 0xff && uchar(buffer[1]) == 0xd8; 1192 1196 } 1193 1197
Note:
See TracChangeset
for help on using the changeset viewer.