Skip to content

Commit ffa4653

Browse files
Use latest underlying API and update build script conformity
1 parent dbd67af commit ffa4653

5 files changed

Lines changed: 191 additions & 177 deletions

File tree

Lines changed: 167 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -1,160 +1,172 @@
11
name: Build
22

33
on:
4-
push:
5-
branches:
6-
- master
7-
tags:
8-
- "v*"
9-
pull_request:
10-
branches:
11-
- master
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- "v*"
9+
pull_request:
10+
branches:
11+
- master
1212

1313
jobs:
14-
Build:
15-
strategy:
16-
matrix:
17-
options:
18-
- os: macos-latest
19-
framework: netcoreapp3.1
20-
runtime: -x64
21-
codecov: false
22-
- os: ubuntu-latest
23-
framework: netcoreapp3.1
24-
runtime: -x64
25-
codecov: false
26-
- os: windows-latest
27-
framework: netcoreapp3.1
28-
runtime: -x64
29-
codecov: true
30-
- os: windows-latest
31-
framework: netcoreapp2.1
32-
runtime: -x64
33-
codecov: false
34-
35-
runs-on: ${{matrix.options.os}}
36-
if: "!contains(github.event.head_commit.message, '[skip ci]')"
37-
38-
steps:
39-
- uses: actions/checkout@v2
40-
41-
# See https://github.com/actions/checkout/issues/165#issuecomment-657673315
42-
- name: Create LFS file list
43-
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
44-
45-
- name: Restore LFS cache
46-
uses: actions/cache@v2
47-
id: lfs-cache
48-
with:
49-
path: .git/lfs
50-
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1
51-
52-
- name: Git LFS Pull
53-
run: git lfs pull
54-
55-
- name: Setup .NET SDKs
56-
uses: actions/setup-dotnet@v1
57-
with:
58-
dotnet-version: |
59-
6.0.x
60-
5.0.x
61-
3.1.x
62-
2.1.x
63-
64-
- name: Install NuGet
65-
uses: NuGet/setup-nuget@v1
66-
67-
- name: Setup Git
68-
shell: bash
69-
run: |
70-
git config --global core.autocrlf false
71-
git config --global core.longpaths true
72-
git fetch --prune --unshallow
73-
git submodule -q update --init --recursive
74-
75-
- name: Setup Azurite
76-
if: matrix.options.os != 'windows-latest'
77-
shell: bash
78-
run: |
79-
sudo npm install -g azurite
80-
sudo azurite --loose &
81-
82-
- name: Setup Azurite Windows
83-
if: matrix.options.os == 'windows-latest'
84-
shell: bash
85-
run: |
86-
npm install -g azurite
87-
azurite --loose &
88-
89-
- name: Setup s3rver
90-
if: matrix.options.os != 'windows-latest'
91-
shell: bash
92-
run: |
93-
sudo npm install -g s3rver
94-
sudo s3rver -d . &
95-
96-
- name: Setup s3rver Windows
97-
if: matrix.options.os == 'windows-latest'
98-
shell: bash
99-
run: |
100-
npm install -g s3rver
101-
s3rver -d . &
102-
103-
- name: Setup NuGet Cache
104-
uses: actions/cache@v2
105-
id: nuget-cache
106-
with:
107-
path: ~/.nuget
108-
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }}
109-
restore-keys: ${{ runner.os }}-nuget-
110-
111-
- name: Build
112-
shell: pwsh
113-
run: ./ci-build.ps1 "${{matrix.options.framework}}"
114-
env:
115-
SIXLABORS_TESTING: True
116-
117-
- name: Test
118-
shell: pwsh
119-
run: ./ci-test.ps1 "${{matrix.options.os}}" "${{matrix.options.framework}}" "${{matrix.options.runtime}}" "${{matrix.options.codecov}}"
120-
env:
121-
SIXLABORS_TESTING: True
122-
XUNIT_PATH: .\tests\ImageSharp.Web.Tests # Required for xunit
123-
124-
- name: Update Codecov
125-
uses: codecov/codecov-action@v1
126-
if: matrix.options.codecov == true && startsWith(github.repository, 'SixLabors')
127-
with:
128-
flags: unittests
129-
130-
Publish:
131-
needs: [Build]
132-
133-
runs-on: windows-latest
134-
135-
if: (github.event_name == 'push')
136-
137-
steps:
138-
- uses: actions/checkout@v2
139-
140-
- name: Install NuGet
141-
uses: NuGet/setup-nuget@v1
142-
143-
- name: Setup Git
144-
shell: bash
145-
run: |
146-
git config --global core.autocrlf false
147-
git config --global core.longpaths true
148-
git fetch --prune --unshallow
149-
git submodule -q update --init --recursive
150-
151-
- name: Pack
152-
shell: pwsh
153-
run: ./ci-pack.ps1
154-
155-
- name: Publish to MyGet
156-
shell: pwsh
157-
run: |
158-
nuget.exe push .\artifacts\*.nupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v2/package
159-
nuget.exe push .\artifacts\*.snupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v3/index.json
160-
# TODO: If github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org
14+
Build:
15+
strategy:
16+
matrix:
17+
options:
18+
- os: macos-latest
19+
framework: netcoreapp3.1
20+
runtime: -x64
21+
codecov: false
22+
- os: ubuntu-latest
23+
framework: netcoreapp3.1
24+
runtime: -x64
25+
codecov: false
26+
- os: windows-latest
27+
framework: netcoreapp3.1
28+
runtime: -x64
29+
codecov: true
30+
- os: windows-latest
31+
framework: netcoreapp2.1
32+
runtime: -x64
33+
codecov: false
34+
35+
runs-on: ${{matrix.options.os}}
36+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
37+
38+
steps:
39+
- name: Git Config
40+
shell: bash
41+
run: |
42+
git config --global core.autocrlf false
43+
git config --global core.longpaths true
44+
45+
- name: Git Checkout
46+
uses: actions/checkout@v2
47+
with:
48+
fetch-depth: 0
49+
submodules: recursive
50+
51+
# See https://github.com/actions/checkout/issues/165#issuecomment-657673315
52+
- name: Git Create LFS file list
53+
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
54+
55+
- name: Restore LFS cache
56+
uses: actions/cache@v2
57+
id: lfs-cache
58+
with:
59+
path: .git/lfs
60+
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1
61+
62+
- name: Git Pull LFS
63+
run: git lfs pull
64+
65+
- name: NuGet Install
66+
uses: NuGet/setup-nuget@v1
67+
68+
- name: NuGet Setup Cache
69+
uses: actions/cache@v2
70+
id: nuget-cache
71+
with:
72+
path: ~/.nuget
73+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }}
74+
restore-keys: ${{ runner.os }}-nuget-
75+
76+
- name: Azurite Setup
77+
if: matrix.options.os != 'windows-latest'
78+
shell: bash
79+
run: |
80+
sudo npm install -g azurite
81+
sudo azurite --loose &
82+
83+
- name: Azurite Setup Windows
84+
if: matrix.options.os == 'windows-latest'
85+
shell: bash
86+
run: |
87+
npm install -g azurite
88+
azurite --loose &
89+
90+
- name: S3rver Setup
91+
if: matrix.options.os != 'windows-latest'
92+
shell: bash
93+
run: |
94+
sudo npm install -g s3rver
95+
sudo s3rver -d . &
96+
97+
- name: S3rver Setup Windows
98+
if: matrix.options.os == 'windows-latest'
99+
shell: bash
100+
run: |
101+
npm install -g s3rver
102+
s3rver -d . &
103+
104+
- name: DotNet Setup
105+
uses: actions/setup-dotnet@v1
106+
with:
107+
dotnet-version: |
108+
6.0.x
109+
5.0.x
110+
3.1.x
111+
2.1.x
112+
113+
- name: DotNet Build
114+
shell: pwsh
115+
run: ./ci-build.ps1 "${{matrix.options.framework}}"
116+
env:
117+
SIXLABORS_TESTING: True
118+
119+
- name: DotNet Test
120+
shell: pwsh
121+
run: ./ci-test.ps1 "${{matrix.options.os}}" "${{matrix.options.framework}}" "${{matrix.options.runtime}}" "${{matrix.options.codecov}}"
122+
env:
123+
SIXLABORS_TESTING: True
124+
XUNIT_PATH: .\tests\ImageSharp.Web.Tests # Required for xunit
125+
126+
- name: Codecov Update
127+
uses: codecov/codecov-action@v1
128+
if: matrix.options.codecov == true && startsWith(github.repository, 'SixLabors')
129+
with:
130+
flags: unittests
131+
132+
Publish:
133+
needs: [Build]
134+
135+
runs-on: ubuntu-latest
136+
137+
if: (github.event_name == 'push')
138+
139+
steps:
140+
- name: Git Config
141+
shell: bash
142+
run: |
143+
git config --global core.autocrlf false
144+
git config --global core.longpaths true
145+
146+
- name: Git Checkout
147+
uses: actions/checkout@v2
148+
with:
149+
fetch-depth: 0
150+
submodules: recursive
151+
152+
- name: NuGet Install
153+
uses: NuGet/setup-nuget@v1
154+
155+
- name: NuGet Setup Cache
156+
uses: actions/cache@v2
157+
id: nuget-cache
158+
with:
159+
path: ~/.nuget
160+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }}
161+
restore-keys: ${{ runner.os }}-nuget-
162+
163+
- name: DotNet Pack
164+
shell: pwsh
165+
run: ./ci-pack.ps1
166+
167+
- name: MyGet Publish
168+
shell: pwsh
169+
run: |
170+
dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.MYGET_TOKEN}} -s https://www.myget.org/F/sixlabors/api/v2/package
171+
dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.MYGET_TOKEN}} -s https://www.myget.org/F/sixlabors/api/v3/index.json
172+
# TODO: If github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org

src/Directory.Build.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<PackageReference Update="Azure.Storage.Blobs" Version="12.10.0" />
2222
<PackageReference Update="Microsoft.IO.RecyclableMemoryStream" Version="2.2.0" />
2323
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
24-
<PackageReference Update="SixLabors.ImageSharp" Version="2.0.0-alpha.0.165" />
24+
<PackageReference Update="SixLabors.ImageSharp" Version="2.0.0-alpha.0.172" />
2525
</ItemGroup>
2626

2727
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">

src/ImageSharp.Web/ImageSharp.Web.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
1010
<RepositoryUrl Condition="'$(RepositoryUrl)' == ''">https://github.com/SixLabors/ImageSharp.Web/</RepositoryUrl>
1111
<PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl>
12-
<PackageTags>Image Middleware Resize Crop Gif Jpg Jpeg Bitmap Png Core Cache ASP</PackageTags>
12+
<PackageTags>Image Middleware Resize Crop Gif Jpg Jpeg Bitmap Png WebP Tiff Core Cache ASP</PackageTags>
1313
<Description>ImageSharp Middleware for serving images via a url based API.</Description>
1414
</PropertyGroup>
1515

src/ImageSharp.Web/Processors/ResizeWebProcessor.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,10 @@ private static Size ParseSize(
148148
IExifValue<ushort> orientation = image.Metadata.ExifProfile.GetValue(ExifTag.Orientation);
149149
return orientation.Value switch
150150
{
151-
// LeftTop, RightTop, RightBottom, LeftBottom
152-
5 or 6 or 7 or 8 => new Size(height, width),
151+
ExifOrientationMode.LeftTop
152+
or ExifOrientationMode.RightTop
153+
or ExifOrientationMode.RightBottom
154+
or ExifOrientationMode.LeftBottom => new Size(height, width),
153155
_ => new Size(width, height),
154156
};
155157
}

0 commit comments

Comments
 (0)