I have committed changes to a PhotoshopPSB branch of libpano that can handle both PSD and PSB file formats.

It was recently brought to my attention that Adobe has opened up the PSB file format to the public in July 2010.

http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/

PSD files are limited to 30000 pixels in both directions. PSB increases this to 300000 pixels.
The extension used to save the file is not important.
The functions to write PSD will automatically save as a PSB fileformat if either dimension is over 30000 pixels. Or a flag can be set to force the file to be PSB.
The functions to read PSD can now read both.

The last couple versions of Photoshop can now handle 16bit layers. This has been enabled for saving PSD files. Previously when saving as a multilayer PSD file layers were always down sampled to 8bit. This can still be forced with a flag.

Naming of the layers was changed from L01 to 001 to accommodate a larger number of layers. Although all the layers can have the same name as far as Photoshop is concerned.


I discovered some code that calculated the size of the data to be stored into a size_t would fail.

I was working with an image 30100X15050 8bit/channel

    // Allocate memory for one channel

    count = im->width * im->height * BitsPerChannel/8 ;

    channel = (unsigned char**)mymalloc( count );


width, & height are pt_int32, & BitsPerChannel is int.
Eventhough it was stored to count as size_t by the time W*H*bpc was done the value was greater than 32bit could hold. It was turned into a a negative number, then when assigned to count, it was ginormous. Many more terabytes than I had. The solution was to force the calculation to use more bits.

    count = (size_t)im->width * im->height * (BitsPerChannel/8) ;


I fixed what I found in libpano in file.c but there may be more like these.

I did some testing but needs more testing with a machine with more memory than the 3GB I have. I was able to create a 5.7GB 8bit per layer file. I run out of memory when I try the 16bit per layer file that was 30100 wide. But I could create smaller files. Only with the 64bit version am I able to allocate enough memory to work we these size images. I only have 3GB and my OS was using most of it. so I don't understand why the 64bit version was able to get the memory and the 23bit version could not.

I uploaded to SourceForge into an experimental folder a windows build 32&64bit of the PTtiff2psd tool for testing. Use this tool to combine many tiff files into a single multilayer PSD or PSB file.
https://sourceforge.net/projects/panotools/files/experimental/
http://wiki.panotools.org/PTtiff2psd


--
Jim Watters
http://photocreations.ca

--
You received this message because you are subscribed to the Google Groups "Hugin and 
other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/hugin-ptx

Reply via email to