blockdiag / sphinxcontrib-blockdiag

Other
16 stars 9 forks source link

sphinxcontrib.nwdiag / WARNING: dot code u'packetdiag header ... images do not match #9

Open krzychb opened 6 years ago

krzychb commented 6 years ago

When building the standard packediag example with Sphinx, the image is not rendered and I am getting the following warning:

WARNING: dot code u'packetdiag header {\n    colwidth = 32\n    node_height = 72\n\n    0-15: Source Port\n    16-31: Destination Port\n    32-63: Sequence Number\n    64-95: Acknowledgment Number\n    96-99: Data Offset\n    100-105: Reserved\n    106: URG [rotate = 270]\n    107: ACK [rotate = 270]\n    108: PSH [rotate = 270]\n    109: RST [rotate = 270]\n    110: SYN [rotate = 270]\n    111: FIN [rotate = 270]\n    112-127: Window\n    128-143: Checksum\n    144-159: Urgent Pointer\n    160-191: (Options and Padding)\n    192-223: data [colheight = 3]\n}': images do not match
generating indices... genindex

If I remove all [rotate = 270] attributes, then the image do renders and this warning is gone.

My configuration is as follows: conf.py

extensions = ['breathe',
              'sphinxcontrib.blockdiag',
              'sphinxcontrib.seqdiag',
              'sphinxcontrib.actdiag',
              'sphinxcontrib.nwdiag',
              'sphinxcontrib.rackdiag',
              'sphinxcontrib.packetdiag'
             ]

# Set up font for blockdiag, nwdiag, rackdiag and packetdiag
blockdiag_fontpath = '_static/DejaVuSans.ttf'
seqdiag_fontpath = '_static/DejaVuSans.ttf'
actdiag_fontpath = '_static/DejaVuSans.ttf'
nwdiag_fontpath = '_static/DejaVuSans.ttf'
rackdiag_fontpath = '_static/DejaVuSans.ttf'
packetdiag_fontpath = '_static/DejaVuSans.ttf'

requirements.txt

sphinx==1.6.5
sphinx-rtd-theme
breathe==4.7.3
sphinxcontrib.blockdiag==1.5.3
sphinxcontrib.seqdiag==0.8.5
sphinxcontrib.actdiag==0.8.5
sphinxcontrib.nwdiag==0.9.5

The same issue happens when building on a PC with Ubuntu 16.04 and Windows with MSYS2

Where to look in the code / what to tweak to resolve this issue?

SunbrightShinobi commented 6 years ago

I have same issue with Sphinx 1.4.4. Builds just fine without [rotate = x] and [colheight = 3] works fine. I tested the rotate in the interactive shell and it works as intended.

http://interactive.blockdiag.com/packetdiag/

SunbrightShinobi commented 6 years ago

So I found this and changed my format to SVG from PNG and rotate works now https://bitbucket.org/blockdiag/blockdiag/issues/72/rotate-not-working-with-pillow-300-and-png

krzychb commented 6 years ago

@binarylandscapes, thank you for posting this workaround!

SunbrightShinobi commented 6 years ago

@krzychb no prob. Be aware though if making PDFs, you will need reportlab installed. I’m working through that now.