Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Canary] Transcoding Support + More Image Format Support (JPEGXL) #3250

Open
wants to merge 49 commits into
base: canary
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
e2a86c6
Add JXL Support.
maxpiva Aug 15, 2024
cb647ad
Make sure if djxl do not exists, continue as usual.
maxpiva Aug 15, 2024
7f6db24
Changed the way conversion happens.
maxpiva Aug 23, 2024
dd0021a
Missing file
maxpiva Aug 23, 2024
efc14ff
Merge branch 'Kareadita:develop' into develop
maxpiva Aug 23, 2024
9d48664
Revert "Changed the way conversion happens."
maxpiva Aug 26, 2024
cf05e5f
Reapply "Changed the way conversion happens."
maxpiva Aug 26, 2024
4902a74
Changed the way conversion happens.
maxpiva Aug 23, 2024
21b4c1b
Merge with Karedita
maxpiva Aug 26, 2024
7d48f6e
Add Documentation
maxpiva Aug 27, 2024
a4a12a1
FIX BOMS
maxpiva Aug 28, 2024
0f98d75
Recode SupportedImageTypesFromRequest removing possible errors.
maxpiva Aug 28, 2024
937f89c
Remove own docker build
maxpiva Aug 28, 2024
a08a795
Shell Call no longer used, since swapped image conversion to Image Ma…
maxpiva Aug 28, 2024
bc8481c
Merge branch 'Kareadita:develop' into JPEG-XL_JPG2000_HEIF
maxpiva Aug 29, 2024
e7f021a
Edit CodeStyle
maxpiva Aug 29, 2024
c624287
Remove custom docker builder
maxpiva Aug 29, 2024
6dbeaf1
Fixed discovered issues.
maxpiva Aug 30, 2024
fead3f6
Merge branch 'Kareadita:develop' into JPEG-XL_JPG2000_HEIF
maxpiva Sep 19, 2024
bf30989
Merge branch 'Kareadita:develop' into JPEG-XL_JPG2000_HEIF
maxpiva Sep 27, 2024
0cc4803
Removed NetVips and ImageSharp (Use only ImageMagick)
maxpiva Sep 28, 2024
10da91c
Remove CropFromDimensions (Geometry will take care)
maxpiva Sep 28, 2024
1541d6a
BOM Changes
maxpiva Sep 28, 2024
23a9aa8
Delete .bak
maxpiva Sep 28, 2024
b6a986a
Bug fixes.
maxpiva Sep 29, 2024
3008ae0
Merge branch 'Kareadita:develop' into RemoveSixLaborsAndNetVips
maxpiva Sep 29, 2024
9bf1fa8
Added SmartCrop (port from smartcrop.js)
maxpiva Oct 1, 2024
170c3b6
Refactor and cleanup.
maxpiva Oct 4, 2024
361c464
BOM Fixes
maxpiva Oct 4, 2024
d6056b8
Update docker-build.sh
maxpiva Oct 4, 2024
92f131a
Fixed Benchmarks
maxpiva Oct 4, 2024
b21ee66
Merge branch 'RemoveSixLaborsAndNetVips' of https://github.com/maxpiv…
maxpiva Oct 4, 2024
4f026e6
Fixed BOM
maxpiva Oct 4, 2024
00ee60b
Requested changes.
maxpiva Oct 10, 2024
fbbbbb8
Removed bak files, fixed EncodeFormat BOM
maxpiva Oct 10, 2024
a0f804b
Removed quality parameter everywhere.
maxpiva Oct 11, 2024
11749bd
Remove quality parameters after refactor.
maxpiva Oct 15, 2024
edbd44b
Bump versions by dotnet-bump-version.
majora2007 Oct 24, 2024
1a88dd4
Lots of Bugfixes (#3308)
majora2007 Oct 25, 2024
7159f40
Added Support for Q8 and Q16 ImageMagick
maxpiva Dec 10, 2024
81c04ad
Merge from develop
maxpiva Dec 10, 2024
dd33037
Merge branch 'Kareadita-develop' into RemoveSixLaborsAndNetVips
maxpiva Dec 10, 2024
9d94ecf
Fix GetRGBAColors Q8 Bug
maxpiva Dec 11, 2024
d1411c1
Merge pull request #2 from Kareadita/develop
maxpiva Dec 11, 2024
d84f07e
FIX BOMs
maxpiva Dec 11, 2024
87e976d
FIX BOMS
maxpiva Dec 11, 2024
44dc556
FIX BOMs
maxpiva Dec 11, 2024
872e64d
Merged with Canaryu
maxpiva Dec 11, 2024
9dccb2d
Merge branch 'Kareadita-canary' into RemoveSixLaborsAndNetVips
maxpiva Dec 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Bug fixes.
  • Loading branch information
maxpiva committed Sep 29, 2024
commit b6a986a685fbb56844d8a11501c13eba695f84f2
11 changes: 9 additions & 2 deletions API/Services/BookService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1276,10 +1276,17 @@ private static void GetPdfPage(IDocReader docReader, int pageNumber, Stream stre
{
using var pageReader = docReader.GetPageReader(pageNumber);
var rawBytes = pageReader.GetImage(new NaiveTransparencyRemover());
var floats = rawBytes.Select(a=> (float)a*256F).ToArray();
var floats = new float[rawBytes.Length];
for (var i = 0; i < rawBytes.Length; i += 4)
{
floats[i] = rawBytes[i + 2] << 8;
floats[i + 1] = rawBytes[i + 1] << 8;
floats[i+2] = rawBytes[i] << 8;
floats[i+3] = rawBytes[i + 3] << 8;
}
var width = pageReader.GetPageWidth();
var height = pageReader.GetPageHeight();
using MagickImage image = new MagickImage(rawBytes, width, height,MagickFormat.Bgra);
MagickImage image = new MagickImage(MagickColor.FromRgba(0, 0, 0,0), width, height);
using var pixels = image.GetPixels();
pixels.SetArea(0,0,width, height, floats);
stream.Seek(0, SeekOrigin.Begin);
Expand Down
2 changes: 1 addition & 1 deletion API/Services/ImageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ public string CreateThumbnailFromBase64(string encodedImage, string fileName, En
try
{

using var thumbnail = new MagickImage(Convert.FromBase64String(encodedImage));
using var thumbnail = MagickImage.FromBase64(encodedImage);
int thumbnailHeight = (int)(thumbnail.Height * ((double)thumbnailWidth / thumbnail.Width));
thumbnail.Thumbnail(thumbnailWidth, thumbnailHeight);
fileName += encodeFormat.GetExtension();
Expand Down