Skip to content

Commit

Permalink
Merge pull request #84 from m4rc1e/img-fix
Browse files Browse the repository at this point in the history
fix zero width images
  • Loading branch information
m4rc1e committed Aug 2, 2023
2 parents 3a63bba + 47c1b19 commit 0a306eb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/diffenator2/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ def set_features(self, features):
def diff(self, string):
img_a = self.renderer_a.render(string)
img_b = self.renderer_b.render(string)
if img_a.size == (0, 0) and img_b.size != (0, 0):
return 99.99, []
if img_b.size == (0, 0) and img_a.size != (0, 0):
return 99.99, []
if img_a.size != img_b.size:
img_a = img_a.resize(img_b.size)
img_a = np.asarray(img_a)
Expand Down

0 comments on commit 0a306eb

Please sign in to comment.