AFM-SPM / TopoStats

An AFM image analysis program to batch process data and obtain statistics from images
https://afm-spm.github.io/TopoStats/
GNU Lesser General Public License v3.0
55 stars 10 forks source link

Resolve .gwy file not loading and add channel support for .gwy files #837

Closed SylviaWhittle closed 1 month ago

SylviaWhittle commented 1 month ago

Closes #832

This PR addresses an issue where the Gwy file loader couldn't load some images - see @zhengyw123's post on discussions.

The issue stemmed from a μ (micro) character used in the file, where the UTF-8 standard was unable to decode it.

Here's a proof of concept of the bug to illustrate the issue: image

I have solved this by simply adding a fallback to using the ISO 8859-1 standard which is able to decode this character, if TopoStats comes across such a character while reading a null-terminated-string.

While I was at it, I added channel support for .gwy files as I lazily didn't add it initially.