Skip to content

Commit

Permalink
fix pixelated images
Browse files Browse the repository at this point in the history
  • Loading branch information
DeDiamondPro committed Sep 28, 2024
1 parent bf0a6c2 commit 6b3059a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
12 changes: 4 additions & 8 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
## Resourcify 1.4.2
## Resourcify 1.4.3

Please make sure to report any bugs and/or visual anomalies on [Resourcify's GitHub](https://github.com/DeDiamondPro/Resourcify/issues) or in the [Discord](https://discord.gg/XtAuqsJWby).

### Changes
This update is mostly to update dependencies and fix some small issues

- (1.21.x NeoForge) Fixed a crash when opening Resourcify's config
- (Fabric) Shade UniversalCraft instead of including it as a jar to resolve Essential asking for a dependency update (this would usually go away after a relaunch, but for some users it didn't, this update will resolve that)
- Dependency updates:
- Updated UniversalCraft to 363
- (1.8.9 and 1.12.2 forge) Updated bundled kotlin to 2.0.20
- Fix buttons getting re-created too many times, causing the fancy menu widget locator to change
- Fix modrinth gallery images using low-res images
- Use linear scaling for images instead of nearest neighbour scaling, fixes modrinth banners and logos looking pixelated due to modrinth switching to lower-resolution images for them.

----------------------------------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ data class FullModrinthProject(
data class DonationUrl(val platform: String, val url: String)

data class GalleryImage(
override val url: String, override val title: String?, override val description: String?, val ordering: Long
@SerializedName("raw_url") override val url: String,
override val title: String?,
override val description: String?,
val ordering: Long
) : IGalleryImage
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of Resourcify
* Copyright (C) 2023 DeDiamondPro
* Copyright (C) 2023-2024 DeDiamondPro
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -41,7 +41,9 @@ fun UIImage.Companion.ofURL(
height: Float? = null,
fit: ImageURLUtils.Fit = ImageURLUtils.Fit.INSIDE,
scaleFactor: Float = UResolution.scaleFactor.toFloat(),
useCache: Boolean = true
useCache: Boolean = true,
minFilter: UIImage.TextureScalingMode = UIImage.TextureScalingMode.LINEAR,
magFilter: UIImage.TextureScalingMode = UIImage.TextureScalingMode.LINEAR,
): UIImage {
val url = source.toURL()
val image = UIImage(
Expand All @@ -56,6 +58,8 @@ fun UIImage.Companion.ofURL(
if (!loadingImage) image.imageHeight = 0.5625f
if (width != null) image.imageWidth = width * scaleFactor
if (height != null) image.imageHeight = height * scaleFactor
image.textureMinFilter = minFilter
image.textureMagFilter = magFilter
return image
}

Expand Down

0 comments on commit 6b3059a

Please sign in to comment.