ArtRage (ptg) Format
Moderators: XnTriq, helmut, xnview
ArtRage (ptg) Format
Please support the ArtRage ptg format in a future release.
As always, thanks for listening!
As always, thanks for listening!
John
Re: ArtRage (ptg) Format
Ok, could you send me some samples? Do you have specifications?JohnFredC wrote:Please support the ArtRage ptg format in a future release.
Pierre.
- maadjordan
- Posts: 25
- Joined: Thu Oct 30, 2003 8:33 pm
artpage..
my first look at the example provided that it has pleanty of png and sort of bitmap images .. so i think i don't need much time to support and it can be handeled as psd in layers or pages..
XnView Arabic Support
ArtRage 2.5 File format
We've just ArtRage 2.5 and I've added a new chunk into the ArtRage painting file format which is the rendered document at full size, in PNG format.
You convinced me to add it sooner, rather than later.
See the following C++ pseudocode. The chunk AR3_FilePreviewLargeOpaque has been added.
To avoid having to read the entire painting files earlier to 2.5 looking for that chunk (and not finding it) I can commit that the AR3_FilePreviewLargeOpaque chunk will immediately follow the AR2_File_ProjectThumbnailImage chunk. (So if you find the AR2_File_ProjectThumbnailImage chunk, and the very next chunk is not AR3_FilePreviewLargeOpaque, you can stop reading as the full-sized preview will not be there).
For painting files previous to the new release I'm afraid you can still only get the 200 x 200 thumbnail.
One day someone will convince me to write the entire compositing pipeline into a handy LIB file. One day...
===================
Badly formatted C++ code follows, but if you send an email to andy@ambientdesign.com I can send you a nicely formatted CPP file.
=====================
You convinced me to add it sooner, rather than later.
See the following C++ pseudocode. The chunk AR3_FilePreviewLargeOpaque has been added.
To avoid having to read the entire painting files earlier to 2.5 looking for that chunk (and not finding it) I can commit that the AR3_FilePreviewLargeOpaque chunk will immediately follow the AR2_File_ProjectThumbnailImage chunk. (So if you find the AR2_File_ProjectThumbnailImage chunk, and the very next chunk is not AR3_FilePreviewLargeOpaque, you can stop reading as the full-sized preview will not be there).
For painting files previous to the new release I'm afraid you can still only get the 200 x 200 thumbnail.
One day someone will convince me to write the entire compositing pipeline into a handy LIB file. One day...
===================
Badly formatted C++ code follows, but if you send an email to andy@ambientdesign.com I can send you a nicely formatted CPP file.
=====================
Code: Select all
#define AR2_File_ProjectThumbnailImage 0x0ff003081
#define AR3_FilePreviewLargeOpaque 0x0ff003b00
#define PBX_File_CanvasColour 0x0ff003007
#define PBX_File_CanvasColourImage 0x0ff00300b
HBITMAP LoadThumbnail(LPCTSTR lpFileName)
{
if (lpFileName == NULL) return NULL;
FILE * cfFile = _wfsopen(lpFileName, L"rb", _SH_DENYNO);
CPNGReader pngReader;
if (cfFile) {
char csHeader[] = "Ambient Design Project file. ";
char csVersion[] = "ArtRage 2";
char csVersion1A[] = "ArtRage";
char csVersion1B[] = "Paintbox";
char buf[200];
memset(buf, 0, sizeof(buf));
fread(buf, sizeof(csHeader) - 1, 1, cfFile);
if (strcmp(csHeader, buf) == 0) {
fread(buf, 2, 1, cfFile); // Spare byte.
memset(buf, 0, sizeof(buf));
fpos_t posVersion;
fgetpos(cfFile, &posVersion);
fread(buf, sizeof(csVersion) - 1, 1, cfFile);
UINT nVersion = 0;
if (strcmp(csVersion, buf) == 0) {
nVersion = 2;
posVersion += sizeof(csVersion); // Advance past the ArtRage 2 version string
}
else if (strncmp(csVersion1A, buf, sizeof(csVersion1A) - 1) == 0) { // Version 1 string "ArtRage"
nVersion = 1;
posVersion += sizeof(csVersion1A); // Advance past the ArtRage 2 version string
}
else if (strncmp(csVersion1B, buf, sizeof(csVersion1B) - 1) == 0) { // Version 1 string "Paintbox"
nVersion = 1;
posVersion += sizeof(csVersion1B); // Advance past the ArtRage 2 version string
}
if (nVersion > 0) { // We found a version string
_fseeki64(cfFile, posVersion + 5, SEEK_SET); // Move to next block (allowing for already-read data
// Parse blocks, looking for Thumbnail block
fpos_t pos;
fgetpos(cfFile, &pos);
UINT64 nFileSize = _filelengthi64(_fileno(cfFile));
UINT64 nFilePos = pos;
UINT nBlockID = 0;
UINT64 nBlockSize = 0;
while (nFilePos < nFileSize - 4) { // Read in the project information.
// Find and process the block.
fread(&nBlockID, sizeof(UINT), 1, cfFile);
fread(&nBlockSize, sizeof(UINT64), 1, cfFile);
if (nBlockSize <1> nFileSize) break; // 'nother silly block.
// Check for paper-colour block
if (nVersion == 1 && nBlockID == PBX_File_CanvasColour) { // Found the paper-colour block
UINT32 pxColour;
fread(&pxColour, sizeof(pxColour), 1, cfFile); // Read in the colour
pngReader.SetPaperColour(pxColour); // Set the paper colour.
}
// Look for Thumbnail block.
else if ((nVersion == 2 && (nBlockID == AR2_File_ProjectThumbnailImage // Thumbnail block found.
|| nBlockID == AR3_FilePreviewLargeOpaque)) // Full-sized preview block found.
||(nVersion == 1 && nBlockID == PBX_File_CanvasColourImage)) { // Colour Map from ArtRage 1 found.
// Read in the PNG image.
char * pMem = NULL;
// cfFile is now pointing to a PNG inlined into the project file. Use something to read PNG from this point.
if (pngReader.ReadImage(cfFile, pMem, nWidth, nHeight)) {
if (nWidth <= 8 || nHeight <8> 100000 || nHeight > 100000) break; // Cabbage out for silly values.
// ***** Do something with the image data
}
if (pMem) free(pMem);
break; // Dont need to search the rest of the project file.
}
// Ensure the file is in the correct position for the next block. Unknown blocks are ignored.
_fseeki64(cfFile, nFilePos + nBlockSize + 12, SEEK_SET); // Move to next block (allowing for already-read data
fgetpos(cfFile, &pos);
nFilePos = pos; // Get the current file location.
}
}
}
fclose(cfFile);
}
return NULL;
}
I should also add...
There is a free Windows Shell extension dll available for download from ArtRage.com
Installing the ARThumb.dll extension will give previews in Windows File browsers if they're in Thumbnail view.
Andy Bearsley
Technical Director
www.artrage.com
There is a free Windows Shell extension dll available for download from ArtRage.com
Installing the ARThumb.dll extension will give previews in Windows File browsers if they're in Thumbnail view.
Andy Bearsley
Technical Director
www.artrage.com
Hm... I can not see that it works. I checked the options -> system integration -> associations but I can not find ArtRage (.ptg) in the list. Tried on two different computers (one Vista and one XP).xnview wrote:You have ArtRage support in 1.93!Troken wrote:Any news on this? Will XnView support ArtRage .PTG? I surely support this suggestion. Latest message here was july 2007, and the 1.93.4 does not seem to support to .PTG
Is it just me or has somebody else also problems with this?
EDIT: I use ArtRage starter edition, the free version - but I dont think it should matter.
Do you have enabled option/Genral/Display all formats?Troken wrote:Hm... I can not see that it works. I checked the options -> system integration -> associations but I can not find ArtRage (.ptg) in the list. Tried on two different computers (one Vista and one XP).xnview wrote:You have ArtRage support in 1.93!Troken wrote:Any news on this? Will XnView support ArtRage .PTG? I surely support this suggestion. Latest message here was july 2007, and the 1.93.4 does not seem to support to .PTG
Is it just me or has somebody else also problems with this?
EDIT: I use ArtRage starter edition, the free version - but I dont think it should matter.
Pierre.
Nooo... I knew that. Just checking...xnview wrote:Do you have enabled option/Genral/Display all formats?Troken wrote:Hm... I can not see that it works. I checked the options -> system integration -> associations but I can not find ArtRage (.ptg) in the list. Tried on two different computers (one Vista and one XP).xnview wrote: You have ArtRage support in 1.93!
Is it just me or has somebody else also problems with this?
EDIT: I use ArtRage starter edition, the free version - but I dont think it should matter.
PS Thank you, it works nicely now.