You can acces the RIOT plug-in from IrfanView by selecting File->Save for web.
Also, there is an option to set file size to use compress to size function in RIOT for JPEG images.
The RIOT for GIMP plug-in is available in the GIMP repository. The DLL version of RIOT is required also.
After you install the GIMP plug-in you can access it by selecting File->Save for web using RIOT.
RIOT is available also as a DLL for developers. Programmers can freely use this DLL as a plugin for their applications. The licence states among other things:
You may use RIOT.DLL in your applications as a plugin and deploy it, provided that such copies contain all the original Product’s contents and proprietary notices
RIOT plugin can be used to provide a image saving method for your applications especially when this feature would be a nice extra and you preffer to use a third party component for that rather than program it from scratch.
Possible uses of the RIOT plugin:
- an image viewer that wants to add the “Save for web” feature or compress to size
- a graphic editing program or a photo editor that wants to add the “Save for web” feature or compress to size
- a computer program that is not mainly intended to process images but lets user export the results as images
- a web application might need “Compress to size” to limit the filesize of uploaded images. An interface to use the DLL in a web application is needed for this.
Developer reference guide
Riot.dll can be used with any programming language capable of using dynamic link libraries. This includes C/C++, Visual Basic, C#, Object Pascal/Delphi, Perl. Other programming languages have experimental or more difficult to implement support for DLLs : PHP, Java, Python. Even if you can’t find here your favourite programming language, probably it has a good method of working with DLLs anyway.
Riot.dll Export Functions
bool RIOT_LoadFromDIB ( HANDLE hDIB, HWND hwndParent=NULL, const char *fileName=”", const char *iniFile=”", int flags=0, const char *buf=”")
Show the optimizer and load a bitmap from a DIB handle. Returns true on success or false on failure
bool RIOT_LoadFromDIB_U(HANDLE hDIB, HWND hwndParent=NULL, const wchar_t *fileName = LPWSTR(“”), const char *iniFile=”", int flags=0)
Unicode version of LoadFromDIB with buf parameter missing (not used anyway)
bool RIOT_LoadFromFile(const char *filename, int flags=0)
Show the optimizer and load a picture from a file on disk. flags parameter is unused Return true on success or false on failure
bool RIOT_LoadFromFile_U(const wchar_t *filename, int flags=0)
Unicode version of LoadFromFile with some parameters missing
void RIOT_Show()
Show the optimizer with no file loaded
int GetPlugInInfo(char *versionString, char *fileFormats)
Sets plugin information Always returns 0
bool RIOT_SaveToFile(HANDLE hDIB, HWND hwndParent,const char *fileName,const char *origFilename=”", unsigned long byteSize=0,char *errorText=”",int flags=0, char *buf=”")
Saves the file with the specified parameters.
Parameters:
hDIB – handle to a Windows DIB image in memory
hwndParent – Not Used. Must be NULL.
fileName – full path to the file to be saved (only JPEG is supported)
origFilename – not used. Fill this with the original file name if no changes to the image have been done
byteSize – filesize of the compressed JPEG image in bytes
errorText – On error errorText is filled with the error message
flags – save flags. See bellow
buf – not used. Leave blank.THe function returns true on success or false on error.If you specify byteSize you can specify any of the save flags, but the quality will not be used.
If you don’t specify byteSize flags are used.
If there are no flags or byteSize is 0 an error is thrown.Flags for RIOT_SaveToFile:0×0001 – keep EXIF
0×0002 – keep IPTC
0×0004 – keep XMP
0×0008 – keep Comments
0×1000 – keep ICC profile0×0800 – save greyscale
0×2000 – save progressive
0×10000 – disable chroma subsamplingAlso you can set a quality flag from 1 to 100Ex: flags=JPEG_SUBSAMPLING_444 | JPEG_PROGRESSIVE | 90
results in a file with no subsampling, progressive with a quality of 90
If you don’t specify quality 75 is used.
You must specify JPEG_PROGRESSIVE if you want progressive.
If you don’t specify JPEG_SUBSAMPLING_444 a default chroma of 4:2:0 is used.
bool RIOT_SaveToFile_U (HANDLE hDIB, HWND hwndParent, const wchar_t *fileName, const wchar_t *origFilename=LPWSTR(“”), unsigned long byteSize=0, char *errorText=”", int flags=0)
Unicode version of SaveToFile
Functions not present in RIOT Lite:
bool RIOT_LoadFromHBITMAP(HBITMAP hbmp)
Show the optimizer and load a bitmap from a HBITMAP handle Returns true on success or false on failure


6 comments
Comments feed for this article
Trackback link
http://luci.criosweb.ro/riot/dll-version/trackback/
January 25, 2009 at 7:27 am
Anna McCullough
Question on the metadata section – for me, that area is always grayed out and I cannot uncheck anything (meaning that this little plugin always strips out everything) – this happens both in the Lite and Extended versions. I’m running Irfanview 4.21… any ideas? Should I be using the standalone version?
Thanks!
January 25, 2009 at 4:44 pm
admin
When used as plugin the image is sent as DIB that is not containing any other informations than RGBA pixels. Unfortunatelly IrfanView does not use 32 bit data, only 24 – and the transparency is not sent.
The metadata is imported though when you open a file by using Riot->Open
In the version 0.3.0 even when the image is a DIB (in the plugin version), if a file exists, metadata, transparency and ICC profile from original file can be imported if the program is set to do it.
July 6, 2010 at 12:56 pm
Manuel
Hello, I’m trying to develop a program in visual basic.net with riot.dll and when I try to reference it from the visual studio project gives me an error. I tried to register it with regsvr32 and regasm and still gives me an error. I wonder what steps I have to follow in order to reference the riot.dll in a visual studio project.
Thanks in advance.
July 7, 2010 at 10:11 am
admin
You can take a look here.
http://support.microsoft.com/kb/106553
For more detauls you will have to post this question to a Visual Basic .NET Forum.
This is a matter of calling a function inside a standard DLL from your programming language.
You don’t need regsvr32 as RIOT is not an ActiveX library.
July 14, 2010 at 8:48 am
Sam
Hello,
Could I possibly get a hold of the source for a Linux port of the dll? This way there may be a Linux version of the library for GIMP?
July 14, 2010 at 10:33 am
admin
This is a closed source project. Anyway, it is heavily dependent on the Windows API.
The FreeImage library used by RIOT, on which a contributed also, is working though on Linux, and has a very flexible license.
RIOT runs under Linux using Wine.