Skip to content

Commit

Permalink
Remove ImageMagick
Browse files Browse the repository at this point in the history
Compat is a pain and we can do the file type check using the magic bits from FileIO.
  • Loading branch information
asinghvi17 committed Jul 9, 2024
1 parent 5f15bf7 commit 01cdac6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Extents = "411431e0-e8b7-467b-b5e0-f676ba4f2910"
GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1"
LRUCache = "8ac3fa9e-de4c-5943-b1dc-09c6b5f20637"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
Expand All @@ -31,7 +30,6 @@ MapTiles = "1"
OrderedCollections = "1"
ThreadSafeDicts = "0.1"
TileProviders = "0.1"
ImageMagick = "1.3"
julia = "1"

[extras]
Expand Down
6 changes: 4 additions & 2 deletions src/Tyler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ using Extents: Extents, Extent
using GeoInterface: GeoInterface
using GeometryBasics: GeometryBasics, GLTriangleFace, Point2f, Vec2f, Rect2f, Rect2, Rect, decompose, decompose_uv
using HTTP: HTTP
using ImageMagick: ImageMagick
using LRUCache: LRUCache, LRU
using MapTiles: MapTiles, Tile, TileGrid, web_mercator, wgs84, CoordinateReferenceSystemFormat
using Makie: Makie, Observable, Figure, Axis, RGBAf, on, isopen, linesegments!, meta, mesh!, translate!, scale!
using Makie: FileIO, ImageIO
using OrderedCollections: OrderedCollections, OrderedSet
using ThreadSafeDicts: ThreadSafeDicts, ThreadSafeDict
using TileProviders: TileProviders, AbstractProvider, geturl, min_zoom, max_zoom
Expand Down Expand Up @@ -302,7 +302,9 @@ end
function fetch_tile(provider::AbstractProvider, tile::Tile)
url = TileProviders.geturl(provider, tile.x, tile.y, tile.z)
result = HTTP.get(url; retry=false, readtimeout=4, connect_timeout=4)
return ImageMagick.readblob(result.body)
io = IOBuffer(result.body)
format = FileIO.query(io) # this interrogates the magic bits to see what to do
return FileIO.load(format) # this actually loads the data using ImageIO.jl or whatever other FileIO loader exists
end

function queue_tile!(tyler::Map, tile)
Expand Down

0 comments on commit 01cdac6

Please sign in to comment.