HtmlDoc: Create a unique filename for cropped images

This commit is contained in:
Vincent Smeets 2023-02-12 19:54:04 +01:00 committed by Nick Hall
parent a99b48711f
commit f6ac1999dd

View File

@ -556,7 +556,10 @@ class HtmlDoc(BaseDoc, TextDoc):
"""
self._empty = 0
size = int(max(w_cm, h_cm) * float(150.0/2.54))
refname = "is%s" % os.path.basename(name)
if crop:
refname = "is-%d-%d-%d-%d-%s" % (crop[0], crop[1], crop[2], crop[3], os.path.basename(name))
else:
refname = "is%s" % os.path.basename(name)
imdir = self._backend.datadirfull()