Skip to content

Support "jpeg" as file extension #2689

Closed

Description

@seisman
In [1]: import pygmt
   ...: fig = pygmt.Figure()
   ...: fig.basemap(region=[0, 10, 0, 10], frame=True)
   ...: fig.savefig("map.jpeg")
---------------------------------------------------------------------------
GMTInvalidInput                           Traceback (most recent call last)
Cell In[1], line 4
      2 fig = pygmt.Figure()
      3 fig.basemap(region=[0, 10, 0, 10], frame=True)
----> 4 fig.savefig("map.jpeg")

File /pygmt/figure.py:315, in Figure.savefig(self, fname, transparent, crop, anti_alias, show, **kwargs)
    310     if ext == "ps":
    311         raise GMTInvalidInput(
    312             "Extension '.ps' is not supported. "
    313             "Please use '.eps' or '.pdf' instead."
    314         )
--> 315     raise GMTInvalidInput(f"Unknown extension '.{ext}'.")
    316 fmt = fmts[ext]
    317 if transparent:

GMTInvalidInput: Unknown extension '.jpeg'.

Currently, only jpg is supported, jpeg is not, and GMT supports both.

Activity

  1. added
    feature request
    on Sep 14, 2023
  2. added this to the 0.11.0 milestone on Sep 15, 2023
  3. self-assigned this
    on Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature request

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions