Ticket #2028: dpi.diff

File dpi.diff, 4.5 KB (added by rd.mora@…, 15 years ago)
  • mythburn/scripts/mythburn.py

     
    6464
    6565dvdPAL=(720,576)
    6666dvdNTSC=(720,480)
     67dvdPALdpi=(75,80)
     68dvdNTSCdpi=(81,72)
    6769
    6870dvdPALHalfD1="352x576"
    6971dvdNTSCHalfD1="352x480"
     
    19901992    node.setAttribute("y1","%d" % int(boundarybox[3] + 1))
    19911993    spunode.appendChild(node)
    19921994
    1993 def createMenu(screensize, numberofitems):
     1995def createMenu(screensize, screendpi, numberofitems):
    19941996    """Creates all the necessary menu images and files for the MythBurn menus."""
    19951997
    19961998    #Get the main menu node (we must only have 1)
     
    20732075            itemnum+=1
    20742076
    20752077        #Save this menu image and its mask
    2076         bgimage.save(os.path.join(getTempPath(),"background-%s.png" % page),"PNG",quality=99,optimize=0)
    2077         bgimagemask.save(os.path.join(getTempPath(),"backgroundmask-%s.png" % page),"PNG",quality=99,optimize=0)
     2078        bgimage.save(os.path.join(getTempPath(),"background-%s.png" % page),"PNG",quality=99,optimize=0,dpi=screendpi)
     2079        bgimagemask.save(os.path.join(getTempPath(),"backgroundmask-%s.png" % page),"PNG",quality=99,optimize=0,dpi=screendpi)
    20782080
    20792081## Experimental!
    20802082##        for i in range(1,750):
     
    21092111        #Move on to the next page
    21102112        page+=1
    21112113
    2112 def createChapterMenu(screensize, numberofitems):
     2114def createChapterMenu(screensize, screendpi, numberofitems):
    21132115    """Creates all the necessary menu images and files for the MythBurn menus."""
    21142116
    21152117    #Get the main menu node (we must only have 1)
     
    21882190                        999, chapter, chapterlist)
    21892191
    21902192        #Save this menu image and its mask
    2191         bgimage.save(os.path.join(getTempPath(),"chaptermenu-%s.png" % page),"PNG",quality=99,optimize=0)
     2193        bgimage.save(os.path.join(getTempPath(),"chaptermenu-%s.png" % page),"PNG",quality=99,optimize=0,dpi=screendpi)
    21922194
    2193         bgimagemask.save(os.path.join(getTempPath(),"chaptermenumask-%s.png" % page),"PNG",quality=99,optimize=0)
     2195        bgimagemask.save(os.path.join(getTempPath(),"chaptermenumask-%s.png" % page),"PNG",quality=99,optimize=0,dpi=screendpi)
    21942196
    21952197        spumuxdom.documentElement.firstChild.firstChild.setAttribute("select",os.path.join(getTempPath(),"chaptermenumask-%s.png" % page))
    21962198        spumuxdom.documentElement.firstChild.firstChild.setAttribute("highlight",os.path.join(getTempPath(),"chaptermenumask-%s.png" % page))
     
    22212223        #Move on to the next page
    22222224        page+=1
    22232225
    2224 def createDetailsPage(screensize, numberofitems):
     2226def createDetailsPage(screensize, screendpi, numberofitems):
    22252227    """Creates all the necessary images and files for the details page."""
    22262228
    22272229    write( "Creating details pages")
     
    22702272                      "", spumuxdom, spunode, numberofitems, 0, "")
    22712273
    22722274        #Save this details image
    2273         bgimage.save(os.path.join(getTempPath(),"details-%s.png" % itemnum),"PNG",quality=99,optimize=0)
     2275        bgimage.save(os.path.join(getTempPath(),"details-%s.png" % itemnum),"PNG",quality=99,optimize=0,dpi=screendpi)
    22742276
    22752277        #Release large amounts of memory ASAP !
    22762278        del draw
     
    28322834
    28332835        if videomode=="ntsc":
    28342836            format=dvdNTSC
     2837            dpi=dvdNTSCdpi
    28352838        elif videomode=="pal":
    28362839            format=dvdPAL
     2840            dpi=dvdPALdpi
    28372841        else:
    28382842            fatalError("Unknown videomode is set (%s)" % videomode)
    28392843
     
    29012905            #for the chapter marks and thumbnails.
    29022906            #create the DVD menus...
    29032907            if wantMainMenu:
    2904                 createMenu(format, files.length)
     2908                createMenu(format, dpi, files.length)
    29052909
    29062910            #Submenus are visible when you select the chapter menu while the recording is playing
    29072911            if wantChapterMenu:
    2908                 createChapterMenu(format, files.length)
     2912                createChapterMenu(format, dpi, files.length)
    29092913
    29102914            #Details Page are displayed just before playing each recording
    29112915            if wantDetailsPage:
    2912                 createDetailsPage(format, files.length)
     2916                createDetailsPage(format, dpi, files.length)
    29132917
    29142918            #DVD Author file
    29152919            if not wantMainMenu and not wantChapterMenu:
     
    31253129    traceback.print_exc(file=sys.stdout)
    31263130    if progresslog != "":
    31273131        traceback.print_exc(file=progressfile)
    3128     write('-'*60)
    3129  No newline at end of file
     3132    write('-'*60)