cutoff of implicit H atoms in JPEG

User 870ab5b546

08-06-2006 13:06:28

This molecule:





Code:
<?xml version="1.0" ?>


<MDocument>


  <MChemicalStruct>


    <molecule molID="m1">


      <atomArray


          atomID="a1 a2 a3"


          elementType="N C R"


          sgroupRef="0 0 sg1"


          x2="-5.331760000000001 -3.7917600000000005 -2.25176"


          y2="1.2250933333333336 1.2250933333333336 1.2250933333333336"


          />


      <bondArray>


        <bond atomRefs2="a2 a1" order="1" />


        <bond atomRefs2="a2 a3" order="1" />


      </bondArray>


      <molecule id="sg1" role="SuperatomSgroup" title="CN" molID="m2">


        <atomArray


            atomID="a4 a5"


            elementType="C N"


            attachmentPoint="1 0"


            x2="-2.25176 -1.4817600000000002"


            y2="1.2250933333333336 -0.10864000000000001"


            />


        <bondArray>


          <bond atomRefs2="a4 a5" order="3" />


        </bondArray>


      </molecule>


    </molecule>


  </MChemicalStruct>


</MDocument>








produces the JPEG below with the molecule.toBinFormat() method. As you can see, the 2 is cut off.

User f359e526a1

09-06-2006 07:34:55

Thanks, I will test it in the new version - again. We had issues with indices in images hoping this had been solved since.

User f359e526a1

14-06-2006 08:41:15

Could you please send me the exact parameters of toBinFormat("jpeg") you are using? I hope I had fixed the thing but want to be certain it works with your exact version as well.

User 870ab5b546

14-06-2006 13:42:10

I was mistaken, we're using MolConverter for the image generation:





Code:
         if (mol.indexOf("Lewis ") > -1) { // LewisSketch


            String xml = MolToXML.getXML(mol);


            ip = new ByteArrayInputStream(xml.getBytes());


            convertParams = "jpeg:mono,H_off,wireframe,#ffffff";


         } else { // Marvin MOL


            ip = new ByteArrayInputStream(mol.getBytes());


            convertParams = "jpeg:mono,H_heteroterm,wireframe,#ffffff";


         }


         // compute a reasonable scaling factor


         MolImageSize molIimageSize = MolImporter.importMol(mol).


            getImageSize(convertParams + "scale" + initialScale);


         int myScale = (optWidth * initialScale) / molIimageSize.width;


         myScale = (myScale > maxScale) ? maxScale : myScale;


         DataOutputStream op =


            new DataOutputStream(new FileOutputStream(imgfile));


         MolConverter mcv = new MolConverter(ip, op, convertParams


            + "scale" + myScale, false);


User f359e526a1

28-06-2006 15:33:44

Seems it is OK by now - actually I found an other nasty bug with the help of your comment - thank you! The fix will appear in the shiny new release that is really not so far.

User 870ab5b546

30-06-2006 00:12:04

szilva wrote:
The fix will appear in the shiny new release that is really not so far.
Quite a number of fixes should appear in that shiny new release. I'm confident it will be bug-free! I eagerly await it.

User 870ab5b546

26-07-2006 01:39:27

I also find that when a jpeg is made of a document containing electron-flow arrows that are the nearest objects to the margin, the furthest loops of the electron-flow arrows are often cut off. See picture.

ChemAxon 7c2d26e5cf

26-07-2006 13:01:36

I have tested the development version of Marvin: I have drawn your structure, saved it then converted to jpeg. The generated image seems to be OK.