Opened 7 years ago

Closed 7 years ago

#15728 closed defect (fixed)

Graphics3d saves every png image twice

Reported by: niles Owned by: probinso
Priority: major Milestone: sage-6.2
Component: graphics Keywords: beginner
Cc: niles Merged in:
Authors: Philip Robinson Reviewers: Niles Johnson
Report Upstream: N/A Work issues:
Branch: u/niles/ticket/15728 (Commits) Commit: d6024feeaf652419b3a23072aef5ab2d6c3722f5
Dependencies: Stopgaps:

Description

In Graphics3d.save sage creates a png file and then uses PIL to convert it to whatever format was requested. But the check for whether to save another format is broken and so sage always creates a second file, even if it's just converting from png to png.

The reason for this is a broken check for the file extension:

if ext != 'png' should instead be if ext != '.png' since ext begins with a dot!

Change History (12)

comment:1 Changed 7 years ago by niles

  • Cc niles added
  • Keywords beginner added

comment:2 follow-up: Changed 7 years ago by probinso

(new to system, so please forgive)

on line 1290 :

if ext == 'png'

on line 1298 :

if ext != 'png'

so both instances of strcmp parameters are ill formed. I would like to change both of these in my commit.

comment:3 Changed 7 years ago by probinso

  • Owner changed from (none) to probinso

comment:4 in reply to: ↑ 2 Changed 7 years ago by niles

Replying to probinso:

so both instances of strcmp parameters are ill formed. I would like to change both of these in my commit.

Right -- both should be changed :) When you upload the new commit, I'll be happy to review it.

comment:5 Changed 7 years ago by probinso

  • Branch set to u/probinso/ticket/15728
  • Created changed from 01/24/14 21:01:14 to 01/24/14 21:01:14
  • Modified changed from 01/29/14 12:16:23 to 01/29/14 12:16:23

comment:6 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:7 Changed 7 years ago by niles

  • Authors set to Philip Robinson
  • Branch changed from u/probinso/ticket/15728 to u/niles/ticket/15728
  • Commit set to d6024feeaf652419b3a23072aef5ab2d6c3722f5
  • Reviewers set to Niles Johnson

Sorry I dropped this for a while -- rebased to latest development branch (6.2.beta0) and looking at it now.


New commits:

4b87c01Fixed file extension checking saving for plot3d, to insure excess files aren't created
d6024feTrac #15728: rebase to 6.2.beta0

comment:8 Changed 7 years ago by niles

  • Status changed from new to needs_review

I'm happy with the changes and all tests pass; positive review!

comment:9 Changed 7 years ago by niles

  • Status changed from needs_review to positive_review

comment:10 Changed 7 years ago by probinso

Thank you, for reviewing now that I have completed the process once I feel better about moving forward. I will remember to flag later bugs as 'needs_review' next time.

comment:11 Changed 7 years ago by niles

No worries -- good job :) Also remember to include your full name in the Authors section of the ticket properties.

comment:12 Changed 7 years ago by vbraun

  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.