How to set DMG window and background size using javapackager ant task









up vote
0
down vote

favorite












After long struggle I managed to generate (using Ant) on MacOSX (Yosemite) a DMG (of modular JavaFX application that deploys to *.app folder) even with custom icons of the app and DMG volume (both stored as *.icns files in build's package/macosx folder). Drag and drop works, it installs the app, the app launches so everything is fine. Well, almost.



I was tempted to make also the custom background for DMG. It is placed together with the icons in package/macosx folder as App-background.png file (where App part is the name of my app, as it is with icons). And javapackager actually picks up the background, but unfortunately after opening DMG the background seems to be placed in windows' top-left corner, the window itself is like twice the size of the background, so 3/4 of the window's background is just white.



I tried with different PNG sizes, but to no avail. DMG window is always way bigger than the image.



Is there any way to make javapackager (aka fx:deploy which I actually use) to generate DMG with proper settings, that just make the DMG window fit background size?



Edit: It seems like DMG window has actually the size of the PNG (the original background file), but for some reason the image, when displayed as background, is "slightly" scaled down.










share|improve this question



























    up vote
    0
    down vote

    favorite












    After long struggle I managed to generate (using Ant) on MacOSX (Yosemite) a DMG (of modular JavaFX application that deploys to *.app folder) even with custom icons of the app and DMG volume (both stored as *.icns files in build's package/macosx folder). Drag and drop works, it installs the app, the app launches so everything is fine. Well, almost.



    I was tempted to make also the custom background for DMG. It is placed together with the icons in package/macosx folder as App-background.png file (where App part is the name of my app, as it is with icons). And javapackager actually picks up the background, but unfortunately after opening DMG the background seems to be placed in windows' top-left corner, the window itself is like twice the size of the background, so 3/4 of the window's background is just white.



    I tried with different PNG sizes, but to no avail. DMG window is always way bigger than the image.



    Is there any way to make javapackager (aka fx:deploy which I actually use) to generate DMG with proper settings, that just make the DMG window fit background size?



    Edit: It seems like DMG window has actually the size of the PNG (the original background file), but for some reason the image, when displayed as background, is "slightly" scaled down.










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      After long struggle I managed to generate (using Ant) on MacOSX (Yosemite) a DMG (of modular JavaFX application that deploys to *.app folder) even with custom icons of the app and DMG volume (both stored as *.icns files in build's package/macosx folder). Drag and drop works, it installs the app, the app launches so everything is fine. Well, almost.



      I was tempted to make also the custom background for DMG. It is placed together with the icons in package/macosx folder as App-background.png file (where App part is the name of my app, as it is with icons). And javapackager actually picks up the background, but unfortunately after opening DMG the background seems to be placed in windows' top-left corner, the window itself is like twice the size of the background, so 3/4 of the window's background is just white.



      I tried with different PNG sizes, but to no avail. DMG window is always way bigger than the image.



      Is there any way to make javapackager (aka fx:deploy which I actually use) to generate DMG with proper settings, that just make the DMG window fit background size?



      Edit: It seems like DMG window has actually the size of the PNG (the original background file), but for some reason the image, when displayed as background, is "slightly" scaled down.










      share|improve this question















      After long struggle I managed to generate (using Ant) on MacOSX (Yosemite) a DMG (of modular JavaFX application that deploys to *.app folder) even with custom icons of the app and DMG volume (both stored as *.icns files in build's package/macosx folder). Drag and drop works, it installs the app, the app launches so everything is fine. Well, almost.



      I was tempted to make also the custom background for DMG. It is placed together with the icons in package/macosx folder as App-background.png file (where App part is the name of my app, as it is with icons). And javapackager actually picks up the background, but unfortunately after opening DMG the background seems to be placed in windows' top-left corner, the window itself is like twice the size of the background, so 3/4 of the window's background is just white.



      I tried with different PNG sizes, but to no avail. DMG window is always way bigger than the image.



      Is there any way to make javapackager (aka fx:deploy which I actually use) to generate DMG with proper settings, that just make the DMG window fit background size?



      Edit: It seems like DMG window has actually the size of the PNG (the original background file), but for some reason the image, when displayed as background, is "slightly" scaled down.







      dmg javapackager






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 10 at 21:23

























      asked Nov 10 at 18:31









      Cromax

      82011219




      82011219






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          After long investigation I found the (not so obvious and rather not direct) reason for this misbehavior. Fortunately I found also the solution.



          Apparently there's some problem with Finder handling PNG while displaying DMG file. It all comes down to chunk pHYs which contains 3 fields (4b, 4b and 1b long respectively). It is pixels per unit on x axis, pixels per unit on y axis and 0 or 1 for unit (0 no unit, 1 a meter unit). Playing with these values (via hex editor) did change somehow scaling behavior (and window size), but I wasn't able to figure out correct values. Eventually I get rid of this chunk completely (exporting from GIMP as PNG without saving resolution) and that solved the case.



          So for anyone struggling with this: just make sure, there is no pHYs chunk in PNG file.



          Edit: One can do that easily with ImageMagick:



          $ convert image.png -define png:exclude-chunk=pHYs image.png


          This strips pHYs chunk from the image.png file.






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53242151%2fhow-to-set-dmg-window-and-background-size-using-javapackager-ant-task%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote



            accepted










            After long investigation I found the (not so obvious and rather not direct) reason for this misbehavior. Fortunately I found also the solution.



            Apparently there's some problem with Finder handling PNG while displaying DMG file. It all comes down to chunk pHYs which contains 3 fields (4b, 4b and 1b long respectively). It is pixels per unit on x axis, pixels per unit on y axis and 0 or 1 for unit (0 no unit, 1 a meter unit). Playing with these values (via hex editor) did change somehow scaling behavior (and window size), but I wasn't able to figure out correct values. Eventually I get rid of this chunk completely (exporting from GIMP as PNG without saving resolution) and that solved the case.



            So for anyone struggling with this: just make sure, there is no pHYs chunk in PNG file.



            Edit: One can do that easily with ImageMagick:



            $ convert image.png -define png:exclude-chunk=pHYs image.png


            This strips pHYs chunk from the image.png file.






            share|improve this answer


























              up vote
              0
              down vote



              accepted










              After long investigation I found the (not so obvious and rather not direct) reason for this misbehavior. Fortunately I found also the solution.



              Apparently there's some problem with Finder handling PNG while displaying DMG file. It all comes down to chunk pHYs which contains 3 fields (4b, 4b and 1b long respectively). It is pixels per unit on x axis, pixels per unit on y axis and 0 or 1 for unit (0 no unit, 1 a meter unit). Playing with these values (via hex editor) did change somehow scaling behavior (and window size), but I wasn't able to figure out correct values. Eventually I get rid of this chunk completely (exporting from GIMP as PNG without saving resolution) and that solved the case.



              So for anyone struggling with this: just make sure, there is no pHYs chunk in PNG file.



              Edit: One can do that easily with ImageMagick:



              $ convert image.png -define png:exclude-chunk=pHYs image.png


              This strips pHYs chunk from the image.png file.






              share|improve this answer
























                up vote
                0
                down vote



                accepted







                up vote
                0
                down vote



                accepted






                After long investigation I found the (not so obvious and rather not direct) reason for this misbehavior. Fortunately I found also the solution.



                Apparently there's some problem with Finder handling PNG while displaying DMG file. It all comes down to chunk pHYs which contains 3 fields (4b, 4b and 1b long respectively). It is pixels per unit on x axis, pixels per unit on y axis and 0 or 1 for unit (0 no unit, 1 a meter unit). Playing with these values (via hex editor) did change somehow scaling behavior (and window size), but I wasn't able to figure out correct values. Eventually I get rid of this chunk completely (exporting from GIMP as PNG without saving resolution) and that solved the case.



                So for anyone struggling with this: just make sure, there is no pHYs chunk in PNG file.



                Edit: One can do that easily with ImageMagick:



                $ convert image.png -define png:exclude-chunk=pHYs image.png


                This strips pHYs chunk from the image.png file.






                share|improve this answer














                After long investigation I found the (not so obvious and rather not direct) reason for this misbehavior. Fortunately I found also the solution.



                Apparently there's some problem with Finder handling PNG while displaying DMG file. It all comes down to chunk pHYs which contains 3 fields (4b, 4b and 1b long respectively). It is pixels per unit on x axis, pixels per unit on y axis and 0 or 1 for unit (0 no unit, 1 a meter unit). Playing with these values (via hex editor) did change somehow scaling behavior (and window size), but I wasn't able to figure out correct values. Eventually I get rid of this chunk completely (exporting from GIMP as PNG without saving resolution) and that solved the case.



                So for anyone struggling with this: just make sure, there is no pHYs chunk in PNG file.



                Edit: One can do that easily with ImageMagick:



                $ convert image.png -define png:exclude-chunk=pHYs image.png


                This strips pHYs chunk from the image.png file.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 12 at 23:20

























                answered Nov 11 at 0:28









                Cromax

                82011219




                82011219



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53242151%2fhow-to-set-dmg-window-and-background-size-using-javapackager-ant-task%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Top Tejano songwriter Luis Silva dead of heart attack at 64

                    政党

                    天津地下鉄3号線