pcb

pcbdiff fails due to image size mismatch

Bug #1045907 reported by ldoolitt
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcb
Fix Released
Undecided
Unassigned

Bug Description

Even when two boards are the same size, the pcbdiff script sometimes generates images of differing size.
That in turn causes ImageMagick's "composite -stereo" command to fail, and no visual diff is shown.
I can avoid the effect in my use case by removing the "--only-visible" flag to pcb.

The attached pair.tar.gz includes two pcb files, check11.pcb and check12.pcb. To reproduce, "pcbdiff check11.pcb check12.pcb". Sorry the files are so big.

I can believe this behavior is triggered by graphical elements hanging off the edge of the nominal board area, e.g., the line forming the board outline is 10 mils wide and therefore hangs out by 5 mils.
At least for incomplete board designs -- of the kind that I want to track in version control -- sloppiness around the board edge is commonplace for me.

Tags: tools
Revision history for this message
ldoolitt (ldoolitt) wrote :
Revision history for this message
ldoolitt (ldoolitt) wrote :

Patch attached.
While I was in there, I made the 200 dpi default over-ride-able with the environment variable PCBDIFF_DPI.

Revision history for this message
Traumflug (mah-jump-ing) wrote :

Comments on geda-users:

Markus Hitter:

At the first glance I'm not sure wether this is the right fix, it might be a better idea to fix the reason for the differently sized PNG exports.

Kai-Martin Knaak:

> It's not obvious to me what --only-visible is supposed to mean
> to pcb in a batch context.

I use this option in my offline printing script.
   http://www.gedasymbols.org/user/kai_martin_knaak/layoutdruck.sh
It crops the print to the extents of whatever is in teh layout.

However, the option does not work for a print of the bottom side aka
"solderside". Instead, I achieve the same by feeding the postscript file to
epstool.

Revision history for this message
Traumflug (mah-jump-ing) wrote :

Another thing is, all options usable in the GUI are provided on the command line, too, without explicitely coding it this way. I'm not even sure wether it's possible to remove a command line option while keeping it in the GUI.

That said, the question here is wether pcbdiff needs this option.

Revision history for this message
Traumflug (mah-jump-ing) wrote :

Surprise! Trying the two testcase files I get this:

mah@piccard:~/RepRap/pcb$ tools/pcbdiff '/home/mah/RepRap/pcb/PCB.00002935.backup' '/home/mah/RepRap/pcb/PCB.00020492.backup'
Segmentation fault (core dumped)
convert: no decode delegate for this image format `/tmp/pcbdiff.IlNs3iHPZ3' @ error/constitute.c/ReadImage/532.
convert: missing an image filename `/tmp/pcbdiff.IxCs5f7Wby' @ error/convert.c/ConvertImageCommand/3011.
composite: no decode delegate for this image format `/tmp/pcbdiff.IxCs5f7Wby' @ error/constitute.c/ReadImage/532.
composite: missing an image filename `/tmp/pcbdiff.Eb21XgpbhO' @ error/composite.c/CompositeImageCommand/1616.
display: no decode delegate for this image format `/tmp/pcbdiff.Eb21XgpbhO' @ error/constitute.c/ReadImage/532.

It's pcb which crashes on the empty layout. Viewing it in the GUI works.

Revision history for this message
Traumflug (mah-jump-ing) wrote :
Revision history for this message
Traumflug (mah-jump-ing) wrote :
Revision history for this message
Traumflug (mah-jump-ing) wrote :
Revision history for this message
Bert Timmerman (bert-timmerman) wrote :

And now for something completely different:

I copied/modified a blinking pcb graphics diff.

Kind regards,

Bert Timmerman.

Revision history for this message
Traumflug (mah-jump-ing) wrote :

> And now for something completely different

Huh? Please don't hijack bugs. You can open a new one at any time.

Changed in pcb:
status: New → Fix Committed
tags: added: tools
Changed in pcb:
status: Fix Committed → Fix Released
Changed in pcb:
milestone: none → pcb-20140316
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.