mirror of
https://github.com/immich-app/immich.git
synced 2026-02-04 08:49:01 +03:00
fix: use edited thumbs for widgets (#25550)
* fix(server): enforce crop is the first action * chore: test * fix: use edited thumbs for widgets --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
@@ -101,7 +101,7 @@ class ImmichAPI(cfg: ServerConfig) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
suspend fun fetchImage(asset: Asset): Bitmap = withContext(Dispatchers.IO) {
|
suspend fun fetchImage(asset: Asset): Bitmap = withContext(Dispatchers.IO) {
|
||||||
val url = buildRequestURL("/assets/${asset.id}/thumbnail", listOf("size" to "preview"))
|
val url = buildRequestURL("/assets/${asset.id}/thumbnail", listOf("size" to "preview", "edited" to "true"))
|
||||||
val connection = url.openConnection()
|
val connection = url.openConnection()
|
||||||
val data = connection.getInputStream().readBytes()
|
val data = connection.getInputStream().readBytes()
|
||||||
BitmapFactory.decodeByteArray(data, 0, data.size)
|
BitmapFactory.decodeByteArray(data, 0, data.size)
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ class ImmichAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func fetchImage(asset: Asset) async throws(FetchError) -> UIImage {
|
func fetchImage(asset: Asset) async throws(FetchError) -> UIImage {
|
||||||
let thumbnailParams = [URLQueryItem(name: "size", value: "preview")]
|
let thumbnailParams = [URLQueryItem(name: "size", value: "preview"), URLQueryItem(name: "edited", value: "true")]
|
||||||
let assetEndpoint = "/assets/" + asset.id + "/thumbnail"
|
let assetEndpoint = "/assets/" + asset.id + "/thumbnail"
|
||||||
|
|
||||||
guard
|
guard
|
||||||
|
|||||||
Reference in New Issue
Block a user