ome / omero-figure

An OMERO.web app for creating Figures from images in OMERO
http://figure.openmicroscopy.org
GNU Affero General Public License v3.0
15 stars 30 forks source link

Export figure fails with unicode in image name #479

Open will-moore opened 1 year ago

will-moore commented 1 year ago

The export script uses a path based on the image's name to save the image to disk, either to use in a zip or to include into the PDF. But the save fails if the name contains unicode characters.

See https://forum.image.sc/t/omero-figure-export-error/70861

            # create name to save image
            original_name = image.getName()
            img_name = os.path.basename(original_name)
            img_name = "%s_%s.tiff" % (idx, img_name)
        # Save Image to file, then bring into PDF
        pil_img.save(img_name)

Simply need to remove unicode characters - Not too important to preserve the name exactly as they are only used to recognise the images in a zip if user chooses to export "with images".

imagesc-bot commented 1 year ago

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/omero-figure-export-error/70861/3