Commit c08b5850177da5829a5cc304a230bda8f74f371e

Authored by Josh Klontz
1 parent d93507d9

namedPoints() bug fix - canConvert isn't quite good enough, we need to explicitl…

…y check that the coordinates aren't NaN
Showing 1 changed file with 5 additions and 2 deletions
openbr/openbr_plugin.cpp
... ... @@ -188,8 +188,11 @@ QList<QPointF> File::namedPoints() const
188 188 QList<QPointF> landmarks;
189 189 foreach (const QString &key, localMetadata().keys()) {
190 190 const QVariant &variant = m_metadata[key];
191   - if (variant.canConvert<QPointF>())
192   - landmarks.append(variant.value<QPointF>());
  191 + if (variant.canConvert<QPointF>()) {
  192 + const QPointF point = variant.value<QPointF>();
  193 + if (!std::isnan(point.x()) && !std::isnan(point.y()))
  194 + landmarks.append(point);
  195 + }
193 196 }
194 197 return landmarks;
195 198 }
... ...