Opened 6 years ago

Closed 6 years ago

#2615 closed defect (fixed)

Save image: width/height and/or max_size is None

Reported by: Conrad Huang Owned by: Tom Goddard
Priority: normal Milestone:
Component: Input/Output Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

The following bug report has been submitted:
Platform:        Windows-10-10.0.18362
ChimeraX Version: 0.91 (2019-11-25)
Description
open 3fx2
save test_image.png

Log:
UCSF ChimeraX version: 0.91 (2019-11-25)  
© 2016-2019 Regents of the University of California. All rights reserved.  
How to cite UCSF ChimeraX  

> open 3fx2 format mmCIF fromDatabase pdb

3fx2 title:  
Comparison of the crystal structures of A flavodoxin In its three oxidation
states At cryogenic temperatures [more info...]  
  
Chain information for 3fx2 #1  
---  
Chain | Description  
A | flavodoxin  
  
Non-standard residues in 3fx2 #1  
---  
FMN — flavin mononucleotide (riboflavin monophosphate)  
  
  

> save test_image.png

Traceback (most recent call last):  
File "D:\chimerax\ChimeraX.app\bin\lib\site-
packages\chimerax\cmd_line\tool.py", line 258, in execute  
cmd.run(cmd_text)  
File "D:\chimerax\ChimeraX.app\bin\lib\site-
packages\chimerax\core\commands\cli.py", line 2837, in run  
result = ci.function(session, **kw_args)  
File "D:\chimerax\ChimeraX.app\bin\lib\site-
packages\chimerax\core\commands\save.py", line 64, in save  
_handle_unexpected_keyword_error(e, 5)  
File "D:\chimerax\ChimeraX.app\bin\lib\site-
packages\chimerax\core\commands\save.py", line 61, in save  
fmt.export(session, filename, fmt.nicknames[0], **kw)  
File "D:\chimerax\ChimeraX.app\bin\lib\site-packages\chimerax\core\io.py",
line 220, in export  
result = self.export_func(session, path, **kw)  
File "D:\chimerax\ChimeraX.app\bin\lib\site-packages\chimerax\core\image.py",
line 151, in save_image  
if max_size and (width > max_size or height > max_size):  
TypeError: '<' not supported between instances of 'int' and 'NoneType'  
  
TypeError: '  
File "D:\chimerax\ChimeraX.app\bin\lib\site-packages\chimerax\core\image.py",
line 151, in save_image  
if max_size and (width > max_size or height > max_size):  
  
See log for complete Python traceback.  
  




OpenGL version: 3.3.0 - Build 25.20.100.6519
OpenGL renderer: Intel(R) HD Graphics 530
OpenGL vendor: Intel

Change History (3)

comment:1 by Eric Pettersen, 6 years ago

Component: UnassignedInput/Output
Owner: set to Tom Goddard
Platform: all
Project: ChimeraX
Status: newassigned
Summary: ChimeraX bug report submissionSave image: width/height and/or max_size is None

comment:2 by Tom Goddard, 6 years ago

Wow. I just put that code in a few hours ago -- nice working catching it's flaws so fast!

comment:3 by Tom Goddard, 6 years ago

Resolution: fixed
Status: assignedclosed

Fixed.

Forgot that the width/height of an image when not specified are None. I added code a few hours ago that gives a simple error message when the requested size is larger than OpenGL textures can hold. Now it handles the None case.

Note: See TracTickets for help on using tickets.