neurocurator
neurocurator copied to clipboard
Annotations: 'Select area' doesn't work
Steps:
- Click on an annotation of type 'position' in the Annotations tab.
- Click on Select area in the Annotation details panel.
Tested with the publication of ID (DOI) 10.1038/367069a0. The PDF, which is a scan, was attached before the above steps.
Probably linked to #36.
Stack trace:
Traceback (most recent call last):
File "/Users/fonta/repos/neurocurator/neurocurator/annotWidgets.py", line 562, in selectArea
self.selectAreaDlg.exec_()
File "/Users/fonta/repos/neurocurator/neurocurator/areaSelector.py", line 47, in exec_
self.open()
File "/Users/fonta/repos/neurocurator/neurocurator/areaSelector.py", line 65, in open
self.selectDlg = PDFAreaSelectorDlg(self)
File "/Users/fonta/repos/neurocurator/neurocurator/areaSelector.py", line 172, in __init__
self.loadImage()
File "/Users/fonta/repos/neurocurator/neurocurator/areaSelector.py", line 191, in loadImage
image = QtGui.QImage.fromData(self.parent.pages[self.parent.currentPageInd],"PNG");
IndexError: list index out of range
Attempting to create a new annotation of type 'position' gives the following stack trace.
It might reveal the origin of the bug: Ghostscript is not found.
wand.exceptions.DelegateError: FailedToExecuteCommand `'gs'
Traceback (most recent call last):
File "/Users/fonta/repos/neurocurator/neurocurator/areaSelector.py", line 33, in run
with Image(filename=self.parent.fileName, resolution=self.parent.resolution) as pdf:
File "/Users/fonta/conda/envs/pc3.4/lib/python3.4/site-packages/wand/image.py", line 2744, in __init__
self.read(filename=filename, resolution=resolution)
File "/Users/fonta/conda/envs/pc3.4/lib/python3.4/site-packages/wand/image.py", line 2822, in read
self.raise_exception()
File "/Users/fonta/conda/envs/pc3.4/lib/python3.4/site-packages/wand/resource.py", line 222, in raise_exception
raise e
wand.exceptions.DelegateError: FailedToExecuteCommand `'gs' -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pamcmyk32' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 '-r150x150' -dUseCIEColor '-sOutputFile=/var/folders/fk/53tx0z910vq3r01tx4_9mzb1t8mgbm/T/magick-12277QLzCtgdwfqza%d' '-f/var/folders/fk/53tx0z910vq3r01tx4_9mzb1t8mgbm/T/magick-122777DdLmPzr3HDx' '-f/var/folders/fk/53tx0z910vq3r01tx4_9mzb1t8mgbm/T/magick-12277RMA8bWAMCzN6'' (1) @ error/pdf.c/InvokePDFDelegate/292
Traceback (most recent call last):
File "/Users/fonta/repos/neurocurator/neurocurator/areaSelector.py", line 82, in pdfRendered
self.selectDlg = PDFAreaSelectorDlg(self)
File "/Users/fonta/repos/neurocurator/neurocurator/areaSelector.py", line 172, in __init__
self.loadImage()
File "/Users/fonta/repos/neurocurator/neurocurator/areaSelector.py", line 191, in loadImage
image = QtGui.QImage.fromData(self.parent.pages[self.parent.currentPageInd],"PNG");
IndexError: list index out of range