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 {usePalette} from '../../lib/hooks/usePalette'
import {useStores} from '../../../state' import {useStores} from '../../../state'
const MAX_WIDTH = 1000 const MAX_WIDTH = 2000
const MAX_HEIGHT = 1000 const MAX_HEIGHT = 2000
const MAX_SIZE = 300000 const MAX_SIZE = 1000000
const IMAGE_PARAMS = { const IMAGE_PARAMS = {
width: 1000, width: 2000,
height: 1000, height: 2000,
freeStyleCropEnabled: true, freeStyleCropEnabled: true,
forceJpg: true, // ios only forceJpg: true, // ios only
compressImageQuality: 1.0, compressImageQuality: 1.0,
+2 -2
View File
@@ -55,7 +55,7 @@ export function Component({
} }
const onSelectNewAvatar = async (img: PickedImage) => { const onSelectNewAvatar = async (img: PickedImage) => {
try { try {
const finalImg = await compressIfNeeded(img, 300000) const finalImg = await compressIfNeeded(img, 1000000)
setNewUserAvatar(finalImg) setNewUserAvatar(finalImg)
setUserAvatar(finalImg.path) setUserAvatar(finalImg.path)
} catch (e: any) { } catch (e: any) {
@@ -64,7 +64,7 @@ export function Component({
} }
const onSelectNewBanner = async (img: PickedImage) => { const onSelectNewBanner = async (img: PickedImage) => {
try { try {
const finalImg = await compressIfNeeded(img, 500000) const finalImg = await compressIfNeeded(img, 1000000)
setNewUserBanner(finalImg) setNewUserBanner(finalImg)
setUserBanner(finalImg.path) setUserBanner(finalImg.path)
} catch (e: any) { } catch (e: any) {
+4 -4
View File
@@ -33,8 +33,8 @@ export function UserAvatar({
openCamera({ openCamera({
mediaType: 'photo', mediaType: 'photo',
cropping: true, cropping: true,
width: 1000, width: 2000,
height: 1000, height: 2000,
cropperCircleOverlay: true, cropperCircleOverlay: true,
forceJpg: true, // ios only forceJpg: true, // ios only
compressImageQuality: 1, compressImageQuality: 1,
@@ -50,8 +50,8 @@ export function UserAvatar({
await openCropper({ await openCropper({
mediaType: 'photo', mediaType: 'photo',
path: item.path, path: item.path,
width: 1000, width: 2000,
height: 1000, height: 2000,
cropperCircleOverlay: true, cropperCircleOverlay: true,
forceJpg: true, // ios only forceJpg: true, // ios only
compressImageQuality: 1, compressImageQuality: 1,
+8 -8
View File
@@ -25,10 +25,10 @@ export function UserBanner({
openCamera({ openCamera({
mediaType: 'photo', mediaType: 'photo',
cropping: true, cropping: true,
compressImageMaxWidth: 3000, compressImageMaxWidth: 6000,
width: 3000, width: 6000,
compressImageMaxHeight: 1000, compressImageMaxHeight: 2000,
height: 1000, height: 2000,
forceJpg: true, // ios only forceJpg: true, // ios only
compressImageQuality: 1, compressImageQuality: 1,
includeExif: true, includeExif: true,
@@ -44,10 +44,10 @@ export function UserBanner({
await openCropper({ await openCropper({
mediaType: 'photo', mediaType: 'photo',
path: item.path, path: item.path,
compressImageMaxWidth: 3000, compressImageMaxWidth: 6000,
width: 3000, width: 6000,
compressImageMaxHeight: 1000, compressImageMaxHeight: 2000,
height: 1000, height: 2000,
forceJpg: true, // ios only forceJpg: true, // ios only
compressImageQuality: 1, compressImageQuality: 1,
includeExif: true, includeExif: true,