ArtRage (ptg) Format

Ask for help and post your question on how to use XnView Classic.

Moderators: XnTriq, helmut, xnview

Post Reply
User avatar
JohnFredC
XnThusiast
Posts: 2010
Joined: Wed Mar 17, 2004 8:33 pm
Location: Sarasota Florida

ArtRage (ptg) Format

Post by JohnFredC »

Please support the ArtRage ptg format in a future release.

As always, thanks for listening!
John
User avatar
xnview
Author of XnView
Posts: 43595
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: ArtRage (ptg) Format

Post by xnview »

JohnFredC wrote:Please support the ArtRage ptg format in a future release.
Ok, could you send me some samples? Do you have specifications?
Pierre.
hitler_ibnedir

web site.

Post by hitler_ibnedir »

User avatar
JohnFredC
XnThusiast
Posts: 2010
Joined: Wed Mar 17, 2004 8:33 pm
Location: Sarasota Florida

Post by JohnFredC »

Hi Pierre

Here is a sample (1.1Mb), but I don't have any specs...
John
User avatar
maadjordan
Posts: 25
Joined: Thu Oct 30, 2003 8:33 pm

artpage..

Post by maadjordan »

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
User avatar
JohnFredC
XnThusiast
Posts: 2010
Joined: Wed Mar 17, 2004 8:33 pm
Location: Sarasota Florida

Post by JohnFredC »

This is good news!

I find myself using ArtRage (plus Wacom tablet) as a marker board on my 24" monitor: flow charting, brainstorming, etc. It wasn't intended for that use originally, but it works fantastic for that. Consequently I've many many of these files now and hope for XnView support.
John
AndyRage

ArtRage 2.5 File format

Post by AndyRage »

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.
=====================

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; 
}
Guest

Post by Guest »

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
User avatar
JohnFredC
XnThusiast
Posts: 2010
Joined: Wed Mar 17, 2004 8:33 pm
Location: Sarasota Florida

Post by JohnFredC »

That Shell extension works great. Thank you for it!
John
User avatar
Troken
Posts: 698
Joined: Thu Feb 09, 2006 10:18 am
Location: Sweden

Post by Troken »

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
User avatar
xnview
Author of XnView
Posts: 43595
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

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
You have ArtRage support in 1.93!
Pierre.
User avatar
Troken
Posts: 698
Joined: Thu Feb 09, 2006 10:18 am
Location: Sweden

Post by Troken »

xnview wrote:
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
You have ArtRage support in 1.93!
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).

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.
User avatar
xnview
Author of XnView
Posts: 43595
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

Troken wrote:
xnview wrote:
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
You have ArtRage support in 1.93!
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).

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?
Pierre.
User avatar
Troken
Posts: 698
Joined: Thu Feb 09, 2006 10:18 am
Location: Sweden

Post by Troken »

xnview wrote:
Troken wrote:
xnview wrote: You have ArtRage support in 1.93!
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).

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?
Nooo... Image I knew that. Just checking...

PS Thank you, it works nicely now.
User avatar
Troken
Posts: 698
Joined: Thu Feb 09, 2006 10:18 am
Location: Sweden

Re:

Post by Troken »

xnview wrote:Do you have enabled option/Genral/Display all formats?
How come this is not enabled by default?
Post Reply