anixon Posted July 24, 2007 Share Posted July 24, 2007 (edited) This looks like a great script which for some reason does not run on my system (Windows XP SP2). I have downloaded AutoIT Beta v 3.2.5.0 and when running the Syntax Check Beta I get the following console message: C:\PLMapper\image_get_info.au3(76,21) : ERROR: DllStructDelete(): undefined function. DllStructDelete($p)If I go to Beta Help - DllStructDelete is not a listed Fuction ReferenceEditAnd this reference to the latest version of the scripts zip file failshttp://www.autoitscript.com/forum/index.ph...13096&st=15Ant.. Edited July 25, 2007 by anixon Link to comment Share on other sites More sharing options...
Lazycat Posted July 25, 2007 Author Share Posted July 25, 2007 Any plans on adding Write functionality?Hm, what you want to write here? Anyway, no plans for writing.This looks like a great script which for some reason does not run on my system (Windows XP SP2).Assume you downloaded version from first post. There was very old one. Now I'm updated it, so you can download it again. 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...
forumsUID Posted August 31, 2007 Share Posted August 31, 2007 Dear LazyCat et al., First of all, let me say that, at a glance, I am very intrigued and impresed both by Autoit and ImageGetInfo. I am entirely new to AUTOIT (and pretty new to programming in general - some vbscript, javascript and vba experience) and stumbled upon this site while looking for a way to read metadata from tiff files. Can you clarify the following for me and maybe give me some advice. Can ImageGetInfo identify and output any tiff tag based on the tag number? I am using an MS Access database to record information about images files on my PC. I can use FileSystemObject to get basic info and save it to my table, but ideally I want to tell Access to access more specific tiff tag information and save that too. Is this at all possible either by using your ImageGetInfo or by any other means you are aware of? Many thanks for you help. forumsUID Link to comment Share on other sites More sharing options...
magician13134 Posted November 22, 2007 Share Posted November 22, 2007 Thank you very much Lazycat! Very good UDF! Thanks again for this! Visit Magic Soft Inc. for some of my software Link to comment Share on other sites More sharing options...
olivertwistcoder Posted December 11, 2007 Share Posted December 11, 2007 I made this program to be used with your. If it can help someone... Use : Select a folder, find jpeg files, take the date with year and month, create a folder if not exist, and move files to it, according to their date file property. So simple, so easy to use, and so helpful to sort your pics from your cam #Include <date.au3> #include <file.au3> #Include <GUIconstants.au3> #include "image_get_info.au3" $replog = IniRead("mediasfinder.ini", "replog", "key", "NotFound") $adminlog = IniRead("mediasfinder.ini", "adminlog", "key", "NotFound") $defaultfolder = IniRead("mediasfinder.ini", "Repertoire", "key", "NotFound") $target = FileSelectFolder("Sélection du dossier", "C:\", 2, $defaultfolder) $nb = IniRead("mediasfinder.ini", "NbLogs", "key", "NotFound") $sNewDate = _DateAdd( 'n',-1, _NowCalc()) $look = IniRead("mediasfinder.ini", "extension", "Key", "NotFound") $log = FileOpen($replog & $adminlog, 2) FileWrite($log, "Lancement : ") FileWrite($log, _NowCalcDate() & " " & _DateTimeFormat( _NowCalc(),5) & @CRLF) FileWrite($log, "------------------------------------------------------------------------------" & @CRLF) FileWrite($log, "Fichiers " & $look & " trouvés : " & @CRLF) ;english : FileWrite($log, "Files " & $look & "found : " & @CRLF) FileWrite($log, "------------------------------------------------------------------------------" & @CRLF) FileWrite($log, "Nom initial --->>> Date EXIF ou de fichier -> Destination" & @CRLF) ;english : FileWrite($log, "Initial Name --->>> EXIF's Date or file's date -> Destination" & @CRLF) FileWrite($log, "------------------------------------------------------------------------------" & @CRLF) FileClose($log) For $i=1 to $nb $search = FileFindFirstFile($target & $look) If $search = -1 Then $log = FileOpen($replog & $adminlog, 1) FileWrite($log, "------------------------------------------------------------------------------" & @CRLF) FileWrite($log, "Le programme n'a pas trouvé de fichiers " & $look & @CRLF) ;english : FileWrite($log, "Program didn't find files " & $look & @CRLF) FileWrite($log, "------------------------------------------------------------------------------" & @CRLF) FileClose($log) Else $log = FileOpen($replog & $adminlog, 1) While 1 $file = FileFindNextFile($search) If @error Then ExitLoop If Not @error Then $aInfo = _ImageGetInfo($target & $file) $datefichier = _ImageGetParam($aInfo, "DateTimeOriginal") $remplace = StringReplace($datefichier, ":", "") $final = StringReplace($remplace, " ", "") $t = FileGetTime($target & $file, 1) $anneemois = $t[0] & $t[1] EndIf If $final > 0 Then FileWrite($log, " " & $file & " --->>> " & $final & ".jpg" & " -> " & $anneemois & @CRLF) If FileExists($target & $anneemois) Then FileMove($target & $file, $target & $anneemois & "\" & $final & ".jpg", 8) Else FileWrite($log, @CRLF & "Création du répertoire : " & $anneemois & @CRLF & @CRLF) ;english : FileWrite($log, @CRLF & "Directory creation : " & $anneemois & @CRLF & @CRLF) FileMove($target & $file, $target & $anneemois & "\" & $final & ".jpg", 8) EndIf ; $t = FileGetTime($target & $file, 1, 1) Else $totale = $t[0] & $t[1] & $t[2] & $t[3] & $t[4] & $t[5] FileWrite($log, " " & $file & " --->>> " & $totale & ".jpg" & " -> " & $anneemois & @CRLF) If FileExists($target & $anneemois) Then FileMove($target & $file, $target & $anneemois & "\" & $totale & ".jpg", 8) Else FileWrite($log, @CRLF & "Création du répertoire : " & $anneemois & @CRLF & @CRLF) ;english : FileWrite($log, @CRLF & "Directory creation : " & $anneemois & @CRLF & @CRLF) FileMove($target & $file, $target & $anneemois & "\" & $totale & ".jpg", 8) EndIf EndIf WEnd FileClose($search) FileClose($log) EndIf $log = FileOpen($replog & $adminlog, 1) FileWrite($log, "------------------------------------------------------------------------------" & @CRLF) FileWrite($log, "Fin du traitement" & @CRLF & @CRLF & @CRLF) ;english : FileWrite($log, "End of work" & @CRLF & @CRLF & @CRLF) Next MsgBox(4096, "Fin du traitement", "Tous fichiers trouvés déplacés" & @CRLF & @CRLF & "Et si aucun fichier, eh bien rien !") ;english : MsgBox(4096, "End of work", "All files moved" & @CRLF & @CRLF & "And if no file, so nothing !") Link to comment Share on other sites More sharing options...
olivertwistcoder Posted December 11, 2007 Share Posted December 11, 2007 Update of this script. Include the FileSelectFolder. expandcollapse popup#Include <date.au3> #include <file.au3> #Include <GUIconstants.au3> #include "image_get_info.au3" $replog = IniRead("mediasfinder.ini", "replog", "key", "NotFound") $adminlog = IniRead("mediasfinder.ini", "adminlog", "key", "NotFound") $defaultfolder = IniRead("mediasfinder.ini", "Repertoire", "key", "NotFound") $select = FileSelectFolder("Sélection du dossier", "C:\", $defaultfolder) $target = $select & "\" $nb = IniRead("mediasfinder.ini", "NbLogs", "key", "NotFound") $sNewDate = _DateAdd( 'n',-1, _NowCalc()) $look = IniRead("mediasfinder.ini", "extension", "Key", "NotFound") $log = FileOpen($replog & $adminlog, 2) FileWrite($log, "Lancement : ") FileWrite($log, _NowCalcDate() & " " & _DateTimeFormat( _NowCalc(),5) & @CRLF) FileWrite($log, "------------------------------------------------------------------------------" & @CRLF) FileWrite($log, "Fichiers " & $look & " trouvés : " & @CRLF) FileWrite($log, "------------------------------------------------------------------------------" & @CRLF) FileWrite($log, "Nom initial --->>> Date EXIF ou de fichier -> Destination" & @CRLF) FileWrite($log, "------------------------------------------------------------------------------" & @CRLF) FileClose($log) For $i=1 to $nb $search = FileFindFirstFile($target & $look) If $search = -1 Then $log = FileOpen($replog & $adminlog, 1) FileWrite($log, "------------------------------------------------------------------------------" & @CRLF) FileWrite($log, "Le programme n'a pas trouvé de fichiers dans " & $target & @CRLF) FileWrite($log, "------------------------------------------------------------------------------" & @CRLF) FileClose($log) MsgBox(4096, "Aucun fichier", "Aucun fichier trouvé dans " & $target & @CRLF) Else $log = FileOpen($replog & $adminlog, 1) While 1 $file = FileFindNextFile($search) If @error Then ExitLoop If Not @error Then $aInfo = _ImageGetInfo($target & $file) $datefichier = _ImageGetParam($aInfo, "DateTimeOriginal") $remplace = StringReplace($datefichier, ":", "") $final = StringReplace($remplace, " ", "") $t = FileGetTime($target & $file, 1) $anneemois = $t[0] & $t[1] EndIf If $final > 0 Then FileWrite($log, " " & $file & " --->>> " & $final & ".jpg" & " -> " & $anneemois & @CRLF) If FileExists($target & $anneemois) Then FileMove($target & $file, $target & $anneemois & "\" & $final & ".jpg", 8) Else FileWrite($log, @CRLF & "Création du répertoire : " & $anneemois & @CRLF & @CRLF) FileMove($target & $file, $target & $anneemois & "\" & $final & ".jpg", 8) EndIf Else $totale = $t[0] & $t[1] & $t[2] & $t[3] & $t[4] & $t[5] FileWrite($log, " " & $file & " --->>> " & $totale & ".jpg" & " -> " & $anneemois & @CRLF) If FileExists($target & $anneemois) Then FileMove($target & $file, $target & $anneemois & "\" & $totale & ".jpg", 8) Else FileWrite($log, @CRLF & "Création du répertoire : " & $anneemois & @CRLF & @CRLF) FileMove($target & $file, $target & $anneemois & "\" & $totale & ".jpg", 8) EndIf EndIf WEnd FileClose($search) FileClose($log) EndIf $log = FileOpen($replog & $adminlog, 1) FileWrite($log, "------------------------------------------------------------------------------" & @CRLF) FileWrite($log, "Fin du traitement" & @CRLF & @CRLF & @CRLF) Next MsgBox(4096, "Fin du traitement", "Tous fichiers trouvés déplacés" & @CRLF & @CRLF & "Et si aucun fichier n'avait été trouvé..." & @CRLF & "eh bien keepcool : rien !") Link to comment Share on other sites More sharing options...
colafrysen Posted January 3, 2009 Share Posted January 3, 2009 Hi, i get the wrong resolution with jpeg images Real values: Width - 3872 Height - 2592 UDF Values: Width - 8195 Height - 8207 Everything else seems to work perfectly. Thanks for a great UDF I run Windows XP SP3 Autoit BETA v3.2.12.1 the udf Version: 2.4 Date: 22.05.2007 [font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size] Link to comment Share on other sites More sharing options...
Lazycat Posted January 12, 2009 Author Share Posted January 12, 2009 Hi, i get the wrong resolution with jpeg imagesThis was already fixed, but I forget to replace attached file. Reuploaded newer 2.5 version to first post. 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...
Sunaj Posted March 10, 2009 Share Posted March 10, 2009 @Lazycat, i know this an oldie.. but i would like to add that it for me also is a goldie! Much easier for me to use than go through the whole loading/unloading show with GDI+. Thanks a bunch for making it [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list] Link to comment Share on other sites More sharing options...
Tweaky Posted March 15, 2010 Share Posted March 15, 2010 (edited) I have this script #include <image_get_info.au3> #include <Array.au3> $pfad = "E:\Bild.jpg" $aInfo = _ImageGetInfo($pfad) ConsoleWrite($aInfo & @CRLF) With AutoIt 3.3.0.0 I got this result Make=Canon Model=Canon DIGITAL IXUS 500 Orientation=Normal XResolution=180 YResolution=180 ResolutionUnit=Inch DateTime=2010:03:10 16:15:16 ExposureTime=0.0166666666666667 FNumber=2.8 ExifVersion= DateTimeOriginal=2010:03:10 16:15:16 DateTimeDigitized=2010:03:10 16:15:16 ComponentsConfiguration=YCbCr CompressedBitsPerPixel=3 ShutterSpeedValue=5.90625 ApertureValue=2.96875 ExposureBiasValue=0 MaxApertureValue=2.96875 MeteringMode=MultiSegment Flash=Fired, Auto FocalLength=7.40625 UserComments= SensingMethod=OneChipColorArea ExposureMode=Auto WhiteBalance=Auto DigitalZoomRatio=1 SceneCaptureType=Standard Width=2592 Height=1944 With AutoIt 3.3.4.0 I got this result Width=2592 Height=1944 Can you please look whats going wrong? Thanks Edited March 15, 2010 by Tweaky Link to comment Share on other sites More sharing options...
Lazycat Posted March 18, 2010 Author Share Posted March 18, 2010 This was already fixed in january, but I'm again forget to update first post here (though this was updated on my site). Please redownload and ensure that version is 2.6 from 21.01.2010. 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...
Tweaky Posted March 18, 2010 Share Posted March 18, 2010 Thanks for your fast help. Now it works Link to comment Share on other sites More sharing options...
wolfbartels Posted April 2, 2010 Share Posted April 2, 2010 (edited) @LazyCat Thanks a lot for the very useful image_get_info.au3 Probably after doing some changes, you did not define several variables. As I always use Opt("MustDefineVars",1) I had some problems. I added: In Func ParseExif($hFile, $exif_offset): Local $nTiffHdrOffset,$pHdr,$nIFDOffset,$pCnt,$nIFDCount,$pTag,$nCnt,$id,$nEIFDCount In Func _AddSpecial(ByRef $sInfo, $ID, $nValue): Local $nModeState In Func _IntR($nInt, $nOrder = 1): Local $curbyte and it works, as far as I tested, I tested only with JPGs. Do you know any UDF for adding/editing EXIF-Comments? I need this for a script I'm writing. Edited April 2, 2010 by wolfbartels Link to comment Share on other sites More sharing options...
wolfbartels Posted April 28, 2010 Share Posted April 28, 2010 Hi Coding Cat, (not lazy anymore )On JPG-files of some cameras there are both EXIF-Parameters "UserComments" and "Comment", causing the UDF _ImageGetParam() to become confused, because it searches only for Comment. An easy solution is to include the inicial @LF and final "=" at $aParam when searching in $aData. ;=============================================================================== ; Get param by name from function result ;=============================================================================== Func _ImageGetParam($sData, $sParam) Local $nParamPos = StringInStr(@LF & $sData,@LF & $sParam & "=") ; @LF and "=" added If $nParamPos Then $sData = StringTrimLeft($sData, $nParamPos + StringLen($sParam)) Return StringLeft($sData, StringInStr($sData, @LF) - 1) Endif Return "" EndFuncNow the Func will always give a correct Return.The attached photo is an example for testing this. Link to comment Share on other sites More sharing options...
Lazycat Posted April 29, 2010 Author Share Posted April 29, 2010 wolfbartelsThanks, updated function and added initializations of locals. New version uploaded. 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...
wolfbartels Posted May 4, 2010 Share Posted May 4, 2010 wolfbartelsThanks, updated function and added initializations of locals. New version uploaded.I found another 2 Locals that need to be initialized in Func _ImageGetInfoJPG($hFile, $nFileSize) in new image_get_info.au3 ver 2.7 line 145: Local $t, $nUnitI only tested with JPGs, it works fine now. Link to comment Share on other sites More sharing options...
KaFu Posted May 25, 2010 Share Posted May 25, 2010 Great UDF, thanks a lot for this one . Attached PNG sends _ImageGetInfoPNG() into an endless loop. I solved it by replacing this: Func _ImageGetInfoPNG($hFile) Local $sInfo = "", $nNextOffset = 8, $nBlockSize, $nID Local $nBPP, $nCol, $sAlpha, $nXRes, $nYRes, $sKeyword, $nKWLen Local $pBlockID = DllStructCreate("ulong;ulong") While $nID <> 0x49444154; IDAT (picture data) $pBlockID = _FileReadToStruct($pBlockID, $hFile, $nNextOffset) $nBlockSize = _IntR(DllStructGetData($pBlockID, 1)) $nID = _IntR(DllStructGetData($pBlockID, 2)) with this: Func _ImageGetInfoPNG($hFile) Local $sInfo = "", $nNextOffset = 8, $nBlockSize, $nID Local $nBPP, $nCol, $sAlpha, $nXRes, $nYRes, $sKeyword, $nKWLen Local $pBlockID = DllStructCreate("ulong;ulong") Local $nID_Save = -1 While $nID <> 0x49444154 AND $nID <> $nID_Save; IDAT (picture data) $nID_Save = $nID $pBlockID = _FileReadToStruct($pBlockID, $hFile, $nNextOffset) $nBlockSize = _IntR(DllStructGetData($pBlockID, 1)) $nID = _IntR(DllStructGetData($pBlockID, 2)) Â 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 May 28, 2010 Author Share Posted May 28, 2010 KaFuThis is ok as temporary solution, but not fully correct, since some blocks can appear more then once. While script not support this situation anyway, in this case you can miss later blocks. Seems here the bug in the parser somewere - the block sizes are become mad and loop going infinite. Maybe due changes in newer Autoit versions. 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 May 28, 2010 Share Posted May 28, 2010 (edited) ...since some blocks can appear more then once. What's you best guess of how often a block can max appear in a row? 3 times? Then something likes this would be better as a workaround (I think i remember the false $nID returned by above sample picture did not match a case, thus no extra info would be added): Func _ImageGetInfoPNG($hFile) Local $sInfo = "", $nNextOffset = 8, $nBlockSize, $nID Local $nBPP, $nCol, $sAlpha, $nXRes, $nYRes, $sKeyword, $nKWLen Local $pBlockID = DllStructCreate("ulong;ulong") Local $nID_Save = -1, $nID_Save_Counter = 0 While $nID <> 0x49444154 AND $nID_Save_Counter < 4 ; IDAT (picture data) $pBlockID = _FileReadToStruct($pBlockID, $hFile, $nNextOffset) $nBlockSize = _IntR(DllStructGetData($pBlockID, 1)) $nID = _IntR(DllStructGetData($pBlockID, 2)) if $nID = $nID_Save Then $nID_Save_Counter +=1 Else $nID_Save_Counter = 0 endif $nID_Save = $nID Edited May 28, 2010 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...
TheSaint Posted August 11, 2010 Share Posted August 11, 2010 Once again, thanks for sharing! Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) 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