Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ViralBShah authored Jun 4, 2024
2 parents fa0c467 + 8a33981 commit 4f8ba65
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Documenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
- uses: julia-actions/setup-julia@v2
with:
version: nightly # change this to 1.6 once's that's official
show-versioninfo: true # this causes versioninfo to be printed to the action log
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Invalidations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
if: github.base_ref == github.event.repository.default_branch
runs-on: ubuntu-latest
steps:
- uses: julia-actions/setup-julia@v1
- uses: julia-actions/setup-julia@v2
with:
version: '1'
- uses: actions/checkout@v4
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ on:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: 3
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
Expand All @@ -12,4 +28,6 @@ jobs:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Edit the following line to reflect the actual name of the GitHub Secret containing your private key
ssh: ${{ secrets.DOCUMENTER_KEY }}
# ssh: ${{ secrets.NAME_OF_MY_SSH_PRIVATE_KEY_SECRET }}
21 changes: 18 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,25 @@ jobs:
fail-fast: false
matrix:
julia-version: ['1.0', '1.6', '1', 'nightly']
julia-arch: [x64, x86]
os: [ubuntu-latest, macOS-latest, windows-latest]
julia-arch: [x64, x86, aarch64]
os: [ubuntu-latest, windows-latest, macOS-13, macOS-14]
exclude:
- os: macOS-latest
- os: ubuntu-latest
julia-arch: aarch64
- os: windows-latest
julia-arch: aarch64
- os: macOS-13
julia-arch: x86
- os: macOS-13
julia-arch: aarch64
- os: macOS-14
julia-arch: x86
- os: macOS-14
julia-arch: x64
- os: macOS-14
julia-version: '1.6'
- os: macOS-14
julia-version: '1.0'

steps:
- name: Set git to use LF (Windows only)
Expand All @@ -42,3 +56,4 @@ jobs:
- uses: codecov/codecov-action@v4
with:
file: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "FileIO"
uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
version = "1.16.2"
version = "1.16.3"

[deps]
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Expand Down
22 changes: 7 additions & 15 deletions src/registry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ const idImageMagick = :ImageMagick => UUID("6218d12a-5da1-5696-b52f-db25d2ecc6d1
const idMeshIO = :MeshIO => UUID("7269a6da-0436-5bbc-96c2-40638cbb6118")
const idNetpbm = :Netpbm => UUID("f09324ee-3d7c-5217-9330-fc30815ba969")
const idOpenCV = :OpenCV => UUID("f878e3a2-a245-4720-8660-60795d644f2a")
const idQuartzImageIO = :QuartzImageIO => UUID("dca85d43-d64c-5e67-8c65-017450d5d020")
const idRData = :RData => UUID("df47a6cb-8c03-5eed-afd8-b6050d6c41da")
const idStatFiles = :StatFiles => UUID("1463e38c-9381-5320-bcd4-4134955f093a")
const idSixel = :Sixel => UUID("45858cf5-a6b0-47a3-bbea-62219f50df47")
const idVegaLite = :VegaLite => UUID("112f6efa-9a02-5b7d-90c0-432ed331239a")
const idVideoIO = :VideoIO => UUID("d6d074c3-1acf-5d4c-9a43-ef38773959a2")
const idLibSndFile = :LibSndFile => UUID("b13ce0c6-77b0-50c6-a2db-140568b8d1a5")
const idLibSndFile = :LibSndFile => UUID("b13ce0c6-77b0-50c6-a2db-140568b8d1a5")
const idJpegTurbo = :JpegTurbo => UUID("b835a17e-a41a-41e7-81f0-2f016b05efe0")
const idNPZ = :NPZ => UUID("15e1cf62-19b3-5cfa-8e77-841668bca605")

Expand Down Expand Up @@ -102,7 +101,7 @@ function detect_rdata_single(io)
c == UInt8('\n') || return false
return true
end

res = checked_match(io)
if !res
res = detect_compressed(io; formats=["GZIP", "BZIP2", "XZ"]) && !name_matches_compressed_fits(io)
Expand Down Expand Up @@ -164,22 +163,19 @@ add_format(
format"TGA",
(),
".tga",
[idQuartzImageIO, OSX],
[idImageMagick]
)
add_format(
format"GIF",
UInt8[0x47,0x49,0x46,0x38],
".gif",
[idQuartzImageIO, OSX],
[idImageMagick]
)
add_format(
format"PNG",
UInt8[0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a],
".png",
[idImageIO],
[idQuartzImageIO, OSX],
[idImageMagick],
[idOpenCV],
[MimeWriter, SAVE]
Expand All @@ -190,15 +186,13 @@ add_format(
[".jpeg", ".jpg", ".JPG"],
[idJpegTurbo],
[idImageIO],
[idQuartzImageIO, OSX],
[idImageMagick],
[idOpenCV]
) # 0xe1
add_format(
format"BMP",
UInt8[0x42,0x4d],
".bmp",
[idQuartzImageIO, OSX],
[idImageMagick],
[idOpenCV]
)
Expand Down Expand Up @@ -389,7 +383,7 @@ function detecttiff(io)
end
# normal TIFF
detect_noometiff(io) = detecttiff(io) && ((:name propertynames(io)) || !(endswith(io.name, ".ome.tif>") || endswith(io.name, ".ome.tiff>")))
add_format(format"TIFF", detect_noometiff, [".tiff", ".tif"], [idImageIO], [idQuartzImageIO, OSX], [idImageMagick], [idOpenCV])
add_format(format"TIFF", detect_noometiff, [".tiff", ".tif"], [idImageIO], [idImageMagick], [idOpenCV])
# OME-TIFF
detect_ometiff(io) = detecttiff(io) && (:name propertynames(io)) && (endswith(io.name, ".ome.tif>") || endswith(io.name, ".ome.tiff>"))
add_format(format"OMETIFF", detect_ometiff, [".tif", ".tiff"], [:OMETIFF => UUID("2d0ec36b-e807-5756-994b-45af29551fcf")])
Expand Down Expand Up @@ -471,9 +465,7 @@ function detect_stlbinary(io)
number_of_triangle_blocks = read(io, UInt32)
#1 normal, 3 vertices in Float32 + attrib count, usually 0
len != (number_of_triangle_blocks*size_triangleblock)+size_header && (seekstart(io); return false)
skip(io, number_of_triangle_blocks*size_triangleblock-sizeof(UInt16))
attrib_byte_count = read(io, UInt16) # read last attrib_byte
attrib_byte_count != zero(UInt16) && (seekstart(io); return false) # should be zero as not used
skip(io, number_of_triangle_blocks*size_triangleblock)
result = eof(io) # if end of file, we have a stl!
return result
end
Expand All @@ -494,9 +486,9 @@ add_format(format"GZIP", detect_gzip, ".gz", [:Libz => UUID("2ec943e9-cfe8-584d-


# Astro Data
# FITS files are often gziped and given the extension ".fits.gz". We want to load those directly and not dispatch to Libz
function detect_fits(io)
# FITS files can have
# FITS files are often gziped and given the extension ".fits.gz". We want to load those directly and not dispatch to Libz
function detect_fits(io)
# FITS files can have
if name_matches_compressed_fits(io)
return true
end
Expand Down
Binary file not shown.
3 changes: 3 additions & 0 deletions test/query.jl
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ let file_dir = joinpath(@__DIR__, "files"), file_path = Path(file_dir)
@test typeof(q) <: File{format"STL_ASCII"}
q = query(joinpath(file_dir, "binary_stl_from_solidworks.STL"))
@test typeof(q) <: File{format"STL_BINARY"}
# See Pull Request # 388
q = query(joinpath(file_dir, "binary_stl_with_nonzero_attribute_byte_count.stl"))
@test typeof(q) <: File{format"STL_BINARY"}
open(q) do io
@test position(io) == 0
skipmagic(io)
Expand Down

0 comments on commit 4f8ba65

Please sign in to comment.