Order it now! Amazon prioritizes orders on a first come, first served basis.


View Full Version : Can one edit T2B files?


James Bryant
04-21-2008, 01:30 PM
If so, how?

James

HarryT
04-21-2008, 01:33 PM
I'm not sure about editing the actual file, but it's created from the book's cover, and it's very easy (for a MobiPocket book, at least) to change the cover of a book using tompe's "mobi2mobi" tool.

Jellby
04-21-2008, 01:49 PM
I think they are just raw 4-bit images. You can generate them with some programs or scripts, have a look at this thread: http://www.mobileread.com/forums/showthread.php?t=21998

slayda
04-21-2008, 03:21 PM
I think they are just raw 4-bit images. You can generate them with some programs or scripts, have a look at this thread: http://www.mobileread.com/forums/showthread.php?t=21998

If they are just 4 bit RAW images, then you can use an image editor like "Paint Shop Pro". With it you can crop, change the size, change to gray scale, change the color depth to 4 bits and save a RAW. I'll try one tonight to see if that will work.

EDIT; Apparently this does not work & I have doubts that the t2b is, in fact a 144x96 RAW image. When I copy & rename one to "name.raw", I can view it in Paint shop Pro but it shows as 4 very small images. PSP only wants to work with 8 bit files.

HarryT
04-22-2008, 08:57 AM
It's not a 4-bit image but a 2-bit one - 4 grey scales.

tompe
04-22-2008, 09:02 AM
Obviously some people have got it to work. When I tested and put an image in the Cybook and then generated the t2b file the thumbnail was still regenerated when I opened the library. What I wanted to do was to eliminate the time it takes to create the thumbnails.

romi
05-08-2009, 11:14 AM
Hi everyone,

I wish to read mostly HTML and TXT files on my CyBook and wonder if anyone of you ever found a way to create thumbnails for these files. I googled a lot, but no luck for a working solution.

Thanks for your input.

gerraldo
05-08-2009, 11:45 AM
If so, how?

Look at the 3rd post in this thread: KLICK (http://www.mobileread.com/forums/showthread.php?t=17492&highlight=cythumbcreator)

With this nice little tool one can easily create the needed thumbnails. :)

Jellby
05-08-2009, 12:05 PM
It seems .t2b files are just raw binary 4-shades 96x144 images. I'm using this PERL script in linux to create them:

t2b.pl
#!/usr/bin/perl

use GD;

my $palette = $0;
$palette =~ s/[^\/]+$/palette.ppm/;

while ( my $file = shift @ARGV )
{
if ( $file =~ /\.pdf$/ )
{ open IN, "pdftops -f 1 -l 1 -paper match \"$file\" - | convert -resize 96x144 -map \"$palette\" -dither PNM:- | pnmtopng 2>/dev/null |"; }
else
{ open IN, "convert -resize 96x144 -map \"$palette\" -dither \"$file\" PNM:- | pnmtopng 2>/dev/null |"; }
my $in = join( '', <IN> );
close IN;

$image = GD::Image->new( $in );

$k = 3;
@px = ( );

$left = int( ( 96 - $image->width ) / 2 );
$right = 96 - $image->width - $left;
$top = int( ( 144 - $image->height ) / 2 );
$bottom = 144 - $image->height - $top;

$file =~ s/\..+?$/_6090.t2b/;
open OUT, "> $file";

for ( $i = - $top; $i < 144 - $top; $i ++ )
{
for ( $j = - $left; $j < 96 - $left; $j ++ )
{
$px[$k --] = ( ( $i >= 0 and $i < $image->height and $j >= 0 and $j < $image->width ) ? $image->getPixel( $j, $i ) : 3 );
if ( $k < 0 )
{
# this line can be here because 4 divides 96
print OUT chr( $px[0] + 4 * $px[1] + 16 * $px[2] + 64 * $px[3] );
$k = 3;
}
}

}

close OUT;
}

with palette.ppm:
P3
2 2
255
0 0 0 85 85 85 170 170 170 255 255 255

romi
05-08-2009, 01:26 PM
Look at the 3rd post in this thread: KLICK (http://www.mobileread.com/forums/showthread.php?t=17492&highlight=cythumbcreator)

With this nice little tool one can easily create the needed thumbnails. :)

Thank you and big thanks to the developer. I tried the tool and was happy like a small child. Now I can have my economist web subscription snippets in my cybook with an icon.

The developer deserves a tip for this and will get one! ;)
:thanks: