Increase max image resolutions and sizes (#118)

This commit is contained in:
Paul Frazee
2023-01-30 19:26:45 -06:00
committed by GitHub
parent 43bc272615
commit c9c4a107f2
4 changed files with 19 additions and 19 deletions
@@ -14,13 +14,13 @@ import {compressIfNeeded, scaleDownDimensions} from '../../../lib/images'
import {usePalette} from '../../lib/hooks/usePalette'
import {useStores} from '../../../state'
const MAX_WIDTH = 1000
const MAX_HEIGHT = 1000
const MAX_SIZE = 300000
const MAX_WIDTH = 2000
const MAX_HEIGHT = 2000
const MAX_SIZE = 1000000
const IMAGE_PARAMS = {
width: 1000,
height: 1000,
width: 2000,
height: 2000,
freeStyleCropEnabled: true,
forceJpg: true, // ios only
compressImageQuality: 1.0,
+2 -2
View File
@@ -55,7 +55,7 @@ export function Component({
}
const onSelectNewAvatar = async (img: PickedImage) => {
try {
const finalImg = await compressIfNeeded(img, 300000)
const finalImg = await compressIfNeeded(img, 1000000)
setNewUserAvatar(finalImg)
setUserAvatar(finalImg.path)
} catch (e: any) {
@@ -64,7 +64,7 @@ export function Component({
}
const onSelectNewBanner = async (img: PickedImage) => {
try {
const finalImg = await compressIfNeeded(img, 500000)
const finalImg = await compressIfNeeded(img, 1000000)
setNewUserBanner(finalImg)
setUserBanner(finalImg.path)
} catch (e: any) {
+4 -4
View File
@@ -33,8 +33,8 @@ export function UserAvatar({
openCamera({
mediaType: 'photo',
cropping: true,
width: 1000,
height: 1000,
width: 2000,
height: 2000,
cropperCircleOverlay: true,
forceJpg: true, // ios only
compressImageQuality: 1,
@@ -50,8 +50,8 @@ export function UserAvatar({
await openCropper({
mediaType: 'photo',
path: item.path,
width: 1000,
height: 1000,
width: 2000,
height: 2000,
cropperCircleOverlay: true,
forceJpg: true, // ios only
compressImageQuality: 1,
+8 -8
View File
@@ -25,10 +25,10 @@ export function UserBanner({
openCamera({
mediaType: 'photo',
cropping: true,
compressImageMaxWidth: 3000,
width: 3000,
compressImageMaxHeight: 1000,
height: 1000,
compressImageMaxWidth: 6000,
width: 6000,
compressImageMaxHeight: 2000,
height: 2000,
forceJpg: true, // ios only
compressImageQuality: 1,
includeExif: true,
@@ -44,10 +44,10 @@ export function UserBanner({
await openCropper({
mediaType: 'photo',
path: item.path,
compressImageMaxWidth: 3000,
width: 3000,
compressImageMaxHeight: 1000,
height: 1000,
compressImageMaxWidth: 6000,
width: 6000,
compressImageMaxHeight: 2000,
height: 2000,
forceJpg: true, // ios only
compressImageQuality: 1,
includeExif: true,