Penny Posted October 29, 2009 Share Posted October 29, 2009 I've this script to make JPG files into TIF, and it doesn't work for me under seven. After some research I also noticed that the example in the help file for _GDIPlus_ParamAdd doesn't work either (it makes both images, but the second one is just an exact copy of the first one) So I figure some things don't work in GDI+ under W7, is this assumption correct? The function for reference is: expandcollapse popupFunc ConvertImageToTiff($path,$path_out) Local $image Local $CLSID _GDIPlus_Startup() $image = _GDIPlus_BitmapCreateFromFile($path) #Region Tiff Parameters Local Const $TIFColorDepth = 24 Local Const $TIFCompression = $GDIP_EVTCOMPRESSIONNONE Local $CLSID Local $tData Local $tParams Local $pParams $CLSID = _GDIPlus_EncodersGetCLSID("TIF") $tParams = _GDIPlus_ParamInit(2) $tData = DllStructCreate("int ColorDepth;int Compression") DllStructSetData($tData, "ColorDepth", $TIFColorDepth) DllStructSetData($tData, "Compression", $TIFCompression) _GDIPlus_ParamAdd($tParams, $GDIP_EPGCOLORDEPTH, 1, $GDIP_EPTLONG, DllStructGetPtr($tData, "ColorDepth")) _GDIPlus_ParamAdd($tParams, $GDIP_EPGCOMPRESSION, 1, $GDIP_EPTLONG, DllStructGetPtr($tData, "Compression")) If IsDllStruct($tParams) Then $pParams = DllStructGetPtr($tParams) EndIf #EndRegion ; _GDIPlus_ImageSaveToFileEx($image, $path_out, $CLSID, $pParams) _GDIPlus_ImageDispose($image) _GDIPlus_Shutdown() EndFunc My problem here is that no matter what compression I try to assign, it forces LZW compression (even when I want no compression at all). And I need the file to be decompressed so I can work it with Tesseract any ideas? =( Link to comment Share on other sites More sharing options...
Yashied Posted October 29, 2009 Share Posted October 29, 2009 If you are interested in the essence of the "problem", I do not know the solution. If you just need to convert JPG to TIF then here is a solution. 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...
Penny Posted October 29, 2009 Author Share Posted October 29, 2009 (edited) it does the same as my function does, it gives them LZW compression. edit: I just tried _screencapture_capture as a tiff and it also defaults to lzw encription, I just want to know how to remove this compression, is that even possible under Seven? Edited October 29, 2009 by Penny Link to comment Share on other sites More sharing options...
Yashied Posted October 29, 2009 Share Posted October 29, 2009 it does the same as my function does, it gives them LZW compression.Read the thread completely. 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...
Penny Posted October 29, 2009 Author Share Posted October 29, 2009 (edited) great. it works but I need the script to be compiled for it to work (it didn't work out of the precompiled scripts.. why is that? it throws me an error (the same one that other user got in the thread you linked me) C:\Users\Nico\Desktop\09-22\_FreeImageDll.au3 (45) : ==> Subscript used with non-Array variable.: DllCall($dll,'int','_FreeImage_SaveU@16','int',$FIF_TIFF,'ptr',$hImage[0],'wstr',$dest,'int',0x0800) DllCall($dll,'int','_FreeImage_SaveU@16','int',$FIF_TIFF,'ptr',$hImage^ ERROR while the .exe file works without a problem. Edited October 29, 2009 by Penny Link to comment Share on other sites More sharing options...
Penny Posted October 29, 2009 Author Share Posted October 29, 2009 Ok I got that to work by reinstalling Autoit a the 32 bit version, but I can't get other functions, even the simplest ones to work, for example, FreeImage_GetWidth and getheight both return 0 to me every time no matter how I use them. 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