Skip to content

Malformed Checksum Calculated for Some Images #18

@Nhojsl

Description

@Nhojsl

For specific images the calculated checksum produced only contains 2 or 3 characters, instead of the expected 4 character format.

Image

The issue was identified to be a formatting problem in which a calculated checksum containing leading 0's had would have the leading 0's dropped before transmitting the checksum to the Cognex camera. This would result in a failure of the image to be transferred, and our written script to cease running.

To rectify this we made a small modification to the calculate_checksum function to format the return differently. This isn't necessarily the best solution but it did fix the formatting of the checksum in order to make the transmission of large quantities of images consistent and reliable.

Image

old return: "hex(cword).upper()[2:]"

modified return: {:4x}".format(cword)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions