Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Other formats > IMP

Notices

Reply
 
Thread Tools Search this Thread
Old 08-28-2008, 04:55 PM   #1
derrell
Jack O' Apes
derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.
 
derrell's Avatar
 
Posts: 227
Karma: 1939
Join Date: Dec 2007
Location: Oklahoma
Device: Ebookwise 1150, Nokia N810, EZ-Reader, HTC Droid Incredible, Archos 70
Perl only access to imp file info

I have been curious for the past few days if it were possible to get information out of imp format files without using the eBook Publisher software from eti. The api that they provide seems to be full featured and has let nick do some wonderful things managing the imp files. The down side of that, for me at least, is that you need windows for most of it to work.

So being curious I pulled out my Camel book and decided to wade around and see if I could get some of the information out of an imp file. The attached short script is the beginning of what I've been able to extract from unencrypted books so far. There is more but this is pertinent for sorting and searching through a collection of imp ebooks that might have gotten just thrown into a directory with none too descriptive names.

Location of the information in the file came from
http://www.chromakinetics.com/REB1200/imp_format.htm
Attached Files
File Type: pl imp_probe.pl (1.2 KB, 318 views)
derrell is offline   Reply With Quote
Advert
Old 08-28-2008, 05:12 PM   #2
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by derrell View Post
I have been curious for the past few days if it were possible to get information out of imp format files without using the eBook Publisher software from eti. The api that they provide seems to be full featured and has let nick do some wonderful things managing the imp files. The down side of that, for me at least, is that you need windows for most of it to work.

So being curious I pulled out my Camel book and decided to wade around and see if I could get some of the information out of an imp file. The attached short script is the beginning of what I've been able to extract from unencrypted books so far. There is more but this is pertinent for sorting and searching through a collection of imp ebooks that might have gotten just thrown into a directory with none too descriptive names.

Location of the information in the file came from
http://www.chromakinetics.com/REB1200/imp_format.htm
Been there, done that...

I've been working on 'imp_dump.pl' (see here) for the past few months to allow me to dissect an .imp into it's component parts - text/images/links/styles.

Once this is finished the process of re-building the html with images and links and styles can begin.

I 've managed to get most of the .RES filetypes decoded, but still hung up on a few. More on this as I finish...
nrapallo is offline   Reply With Quote
Old 08-28-2008, 06:56 PM   #3
ashkulz
Addict
ashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enough
 
ashkulz's Avatar
 
Posts: 350
Karma: 705
Join Date: Dec 2006
Location: Mumbai, India
Device: Kindle 1/REB 1200
I too have some unfinished code, but now that I can use impmake on Linux I don't think I'll be ever able to work up the enthusiasm to complete it.
ashkulz is offline   Reply With Quote
Old 08-29-2008, 08:20 AM   #4
derrell
Jack O' Apes
derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.
 
derrell's Avatar
 
Posts: 227
Karma: 1939
Join Date: Dec 2007
Location: Oklahoma
Device: Ebookwise 1150, Nokia N810, EZ-Reader, HTC Droid Incredible, Archos 70
Wasn't really going to try for a perl only solution to building imp files. Something more along the lines of being able to catalog the imp files without having to resort to running apps in wine. Actual creation of the imp files that way isn't a problem.

I do want to be able to use something like impfind --author Ringo and have it spew out a list of titles and paths to all of the files. I'm thinking it would be uesful to search on all the fields execpt the id. Shouldn't be too hard for me to do now that I can extract the info from the files. All that is left is just moving through the directory tree and generating the list on the right key.
derrell is offline   Reply With Quote
Old 08-29-2008, 08:29 AM   #5
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by derrell View Post
Wasn't really going to try for a perl only solution to building imp files. Something more along the lines of being able to catalog the imp files without having to resort to running apps in wine. Actual creation of the imp files that way isn't a problem.
I wasn't trying to build a .imp ebook; I was dissecting it so that I could (not yet possible) re-build a .html file that resembles the ones used to create it. But then again, that's not what you were looking for by writing imp_probe.pl, as evident by your below comments. OK got ya!

Quote:
I do want to be able to use something like impfind --author Ringo and have it spew out a list of titles and paths to all of the files. I'm thinking it would be uesful to search on all the fields execpt the id. Shouldn't be too hard for me to do now that I can extract the info from the files. All that is left is just moving through the directory tree and generating the list on the right key.
Yes, this would be very nice, indeed, to have. Keep on truckin'...
nrapallo is offline   Reply With Quote
Advert
Old 08-29-2008, 10:38 AM   #6
ashkulz
Addict
ashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enough
 
ashkulz's Avatar
 
Posts: 350
Karma: 705
Join Date: Dec 2006
Location: Mumbai, India
Device: Kindle 1/REB 1200
Quote:
Originally Posted by derrell View Post
I do want to be able to use something like impfind --author Ringo and have it spew out a list of titles and paths to all of the files. I'm thinking it would be uesful to search on all the fields execpt the id. Shouldn't be too hard for me to do now that I can extract the info from the files. All that is left is just moving through the directory tree and generating the list on the right key.
Look at the first two functions I have written for impserve -- they'll do the job.

Code:
def get_ebook_info(name):
    """ get the details of the IMP book as a tuple """
    if not isfile(name):
        return None
    info = [name, getsize(name), getmtime(name)]
    f = open(name, 'rb')
    if f.read(10) != '\x00\x02BOOKDOUG':
        return None

    def cString(skip=0):
        result = ''
        while 1:
            data = f.read(1)
            if data == '\x00':
                if not skip: return result
                skip -= 1
                result, data = '', ''
            result += data

    f.read(38)
    info += [cString(), cString(), cString(1), cString(2)]
    f.close()
    return tuple(info)
ashkulz is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a kindle.info file on Kindles updated to 2.5.X? KevinH Kindle Developer's Corner 7 09-09-2010 02:15 PM
K2 system file access dwallbaum Amazon Kindle 2 09-08-2010 04:32 PM
Using perl scripts to produce .IMP ebooks and more... nrapallo IMP 43 04-22-2009 12:05 AM
Easist way to modify IMP books internal header info? askyn IMP 23 04-09-2009 10:20 AM
author info on plain txt file jakeluck Sony Reader 6 11-23-2006 06:59 PM


All times are GMT -4. The time now is 12:32 PM.


MobileRead.com is a privately owned, operated and funded community.