Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

96
Vistas
How to precise the min and the max ratios when cropping image in react-native-image-crop-picker

I have a problem. What I wanted is that when a user oppen the image picker, he have a free cropping functions but limited with an aspect ratio of 1.4 at maximum with a max height of about 1000, and 1/3 at minimum and a min width of about 200. But I didn't see any way to do it even after many researchs.

Please can someone help me?

This is my code here :

const takePhotoFromCamera = () => {
    ImagePicker.openCamera({
      compressImageMaxWidth:640,
      compressImageMaxHeight:1000,
      cropping: true,
      freeStyleCropEnabled:true,
    }).then((image) => {
      // console.log(image);
      const imageUri = Platform.OS === 'ios' ? image.sourceURL : image.path;
      const {cropRect} = image;
      const ImgDimensions = {width: cropRect.width, height: cropRect.height};
      setImage(imageUri);
      setImgDims(ImgDimensions);
      // console.log("Image Dimensions: ", imgDims);
    });
  };

  const choosePhotoFromLibrary = () => {
    ImagePicker.openPicker({
      compressImageMaxWidth:640,
      compressImageMaxHeight:1000,
      cropping: true,
      freeStyleCropEnabled:true,
      compressImageQuality:0.8,
      ra
    }).then((image) => {
      console.log(image);
      const imageUri = Platform.OS === 'ios' ? image.sourceURL : image.path;
      const {cropRect} = image;
      const ImgDimensions = {width: cropRect.width, height: cropRect.height};
      setImage(imageUri);
      setImgDims(ImgDimensions);
      // console.log("Image Dimensions: ", imgDims);
    });
  };
7 months ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.