Lazycat Posted October 8, 2010 Author Share Posted October 8, 2010 KaFuI found a time to look into code. It was fully incorrect handling of tEXt section, looks like in my test set was no single file with this block. Also modified code to support for sections that may appear after IDAT section.Now fixed and reuploaded. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
KaFu Posted October 23, 2010 Share Posted October 23, 2010 Great, I'll give it a try , thanks a lot! OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Lazycat Posted November 13, 2010 Author Share Posted November 13, 2010 Uploaded the third incarntion of UDF, that have many parts changed to newest features supported by Autoit (for example, binary strings). Therefore it will not work on earlier versions. This slightly increased speed for complex parsers. Output format remain the same. TIFF/Exif parsers was merged and almost fully rewritten, since their implementation was not fully correct. Added most remain TIFF and Exif tags (all that can have an interest for "end user") and GPS tags as well. Some TIFF advanced features still not supported, but can be in future. Also added second example (GUI) of using UDF. Here surely can be bugs, so try carefully before updating. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
KaFu Posted November 13, 2010 Share Posted November 13, 2010 Thanks for the update! Will definitely be part of SMF 1.4 ... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
UEZ Posted May 2, 2011 Share Posted May 2, 2011 (edited) Can you describe me shortly how to get the color depth of a TIF image? I cannot follow your code... According to the TIF documentation the information should be at offset 0x102 in a TIF file but I cannot see it. What about the color depth of a JPG? Thanks, UEZ PS: great bunch of code! Edited May 2, 2011 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Yashied Posted May 3, 2011 Share Posted May 3, 2011 (edited) Can you describe me shortly how to get the color depth of a TIF image? In most cases, so expandcollapse popup; http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf #Include <WinAPI.au3> Global $Bytes $hFile = _WinAPI_CreateFile(@ScriptDir & '\Test.tif', 2, 2) ; Read TIFF file header (8 bytes) $tData = DllStructCreate('ushort Order;ushort Type;dword Offset') _WinAPI_ReadFile($hFile, DllStructGetPtr($tData), 8, $Bytes) ; Read number of tags (NumDirEntries) from the first IDF pointed to by "Offset" member (2 bytes) _WinAPI_SetFilePointer($hFile, DllStructGetData($tData, 'Offset')) $tData = DllStructCreate('ushort') _WinAPI_ReadFile($hFile, DllStructGetPtr($tData), 2, $Bytes) ; Read all tags from the first IDF (12 * NumDirEntries bytes, the size of each tag = 12 bytes) $Entries = DllStructGetData($tData, 1) $tIFD = DllStructCreate('byte[' & (12 * $Entries) & ']') $pIFD = DllStructGetPtr($tIFD) _WinAPI_ReadFile($hFile, $pIFD, 12 * $Entries, $Bytes) ; Search the necessary tags and read the relevant data (if data size > 4 bytes, the "Value" member contains the offset to this data) For $i = 1 To $Entries $tTag = DllStructCreate('ushort ID;ushort Type;dword Count;dword Value', $pIFD + 12 * ($i - 1)) Switch DllStructGetData($tTag, 'ID') Case 0x0100 ; ImageWidth $W = DllStructGetData($tTag, 'Value') Case 0x0101 ; ImageLength $H = DllStructGetData($tTag, 'Value') Case 0x0102 ; BitsPerSample $Count = DllStructGetData($tTag, 'Count') $Value = DllStructGetData($tTag, 'Value') If $Count > 2 Then _WinAPI_SetFilePointer($hFile, $Value) $tData = DllStructCreate('ushort[' & $Count & ']') _WinAPI_ReadFile($hFile, DllStructGetPtr($tData), 2 * $Count, $Bytes) $BPP = DllStructGetData($tData, 1, 1) Else $BPP = BitAND($Value, 0xFF) EndIf Case 0x0103 ; Compression Switch DllStructGetData($tTag, 'Value') Case 1 $Compression = 'Uncompressed' Case 2 $Compression = 'CCITT Group 3' Case 5 $Compression = 'LZW' Case 7 $Compression = 'JPEG' Case 8 $Compression = 'ZIP' Case 32773 $Compression = 'PackBits' Case Else $Compression = 'Unknown' EndSwitch Case 0x011A ; XResolution _WinAPI_SetFilePointer($hFile, DllStructGetData($tTag, 'Value')) $tData = DllStructCreate('dword[2]') _WinAPI_ReadFile($hFile, DllStructGetPtr($tData), 8, $Bytes) $XRes = Round(DllStructGetData($tData, 1, 1) / DllStructGetData($tData, 1, 2), 2) Case 0x011B ; YResolution _WinAPI_SetFilePointer($hFile, DllStructGetData($tTag, 'Value')) $tData = DllStructCreate('dword[2]') _WinAPI_ReadFile($hFile, DllStructGetPtr($tData), 8, $Bytes) $YRes = Round(DllStructGetData($tData, 1, 1) / DllStructGetData($tData, 1, 2), 2) Case 0x0128 ; ResolutionUnit Switch DllStructGetData($tTag, 'Value') Case 2 $Unit = 'dpi' Case 3 $Unit = 'dpcm' Case Else $Unit = '?' EndSwitch EndSwitch Next _WinAPI_CloseHandle($hFile) ConsoleWrite('Dimensions: ' & $W & ' x ' & $H & ' pixels' & @CR) ConsoleWrite('Resulution: ' & $XRes & ' x ' & $YRes & ' ' & $Unit & @CR) ConsoleWrite('Bit depth: ' & $BPP & ' bpp' & @CR) ConsoleWrite('Compression: ' & $Compression & @CR) TIFF Specification (Revision 6.0) According to the TIF documentation the information should be at offset 0x102 in a TIF file but I cannot see it. 0x102 is not offset, is an ID of the "BitsPerSample" tag. Edited May 3, 2011 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
UEZ Posted May 3, 2011 Share Posted May 3, 2011 (edited) @Yashied: thank you very much for your explanation! I got it know! But you made a mistake at the calculation of the BPP: it should something like this: ... Case 0x0102 ; BitsPerSample $Count = DllStructGetData($tTag, 'Count') $Value = DllStructGetData($tTag, 'Value') If $Count > 2 Then _WinAPI_SetFilePointer($hFile, $Value) $tData = DllStructCreate('ushort[' & $Count & ']') _WinAPI_ReadFile($hFile, DllStructGetPtr($tData), 2 * $Count, $Bytes) For $j = 1 To $Count $BPP += DllStructGetData($tData, 1, $j) Next Else $BPP = BitAND($Value, 0xFF) EndIf ... You forgot to add the values in the struct if bpp is > 8. Br, UEZ Edited May 3, 2011 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Yashied Posted May 3, 2011 Share Posted May 3, 2011 Ahh, I got bits per channel. Thanks. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
enaiman Posted February 14, 2012 Share Posted February 14, 2012 I've read about no plans for a "write" function because "there is no reason to write anything". Well, here is a reason: I do have lots of images taken and I haven't added any copyright info (too lazy to set up the camera to do it but now I learned my lesson). I would like to add the copyright info to these images. AFAIK, it can be done from Photoshop but that doesn't do it in bulk (not sure about the Organiser, have to do a bit of research). So, if you have some spare time would you consider adding write support? Thanks. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
ElEsteban Posted January 24, 2015 Share Posted January 24, 2015 (edited) Hello, This UDF is great I have been using version 3.0 of this script without any problem, but there some images (like one I have attached) that makes the script gives an error; #include <image_get_info.au3> Local $aInfo = _ImageGetInfo("test.jpg") MsgBox(64, "test", $aInfo) If im using SciTE, the script finish giving this error but the msgbox is not displayed; image_get_info.au3" (355) : ==> Array maximum size exceeded.: When I compile it, gives the same error "Error: Array maximum size exceeded" The version 2.8 of the UDF work without problem. I have to check various images in the script, how i can solve or bypass this error? Thanks Edited January 24, 2015 by ElEsteban Link to comment Share on other sites More sharing options...
Udavf Posted September 16, 2017 Share Posted September 16, 2017 Need to add Local to this line, sometimes glitches, mostly on *.gif files Link to comment Share on other sites More sharing options...
wysocki Posted September 14, 2019 Share Posted September 14, 2019 What an old thread! But since Lazycat now hasn't logged into this forum since 2015, it may be that cat has just had his 10th life! In fact, lots of threads have not seen action in a decade or more and there aren't a lot of recent activity. Sign of the times? Is AutoIt gone along with the time of the desktop PC? Anyway, is anyone doing anything with this code? I've tried it since I'd like to be able to get exif GPS location from my images, then send that to Google and get verbage about where the pic was taken. Hopefully incorporating that into my slide shows somehow. I"ve tried the v3.0 udf on my pics and just get garbage back for GPS latitude and longitude. Anyone able to help with this problem? Link to comment Share on other sites More sharing options...
KaFu Posted September 16, 2019 Share Posted September 16, 2019 (edited) On 9/14/2019 at 2:29 AM, wysocki said: Anyway, is anyone doing anything with this code? I've tried it since I'd like to be able to get exif GPS location from my images, then send that to Google and get verbage about where the pic was taken. Hopefully incorporating that into my slide shows somehow. Take a look at the cGDIPlus_ImageGetAllPropertyItems() function here, it extracts GPS for my IPhone photos just fine: Edited September 16, 2019 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now