Crop Upload Image

Demo to preview the plugin:

Introduction

This no-code plugin is mainly designed to upload images to AWS S3. The download process takes place within the S3 account provided by Bubble, ensuring access to the stored images.
πŸ”” The most risk-free way to try out this plugin is to subscribe to it. If you unsubscribe a few days later you will be charged on pro-rata basis, so for example if the plugin monthly price is $5 then you’d pay only 17Β’ per day ($5/30 days)!
Image without caption

How to setup

  1. Configure the properties of the CropUpload element.
After adding the element to your page, access the properties panel and customize the following fields:
  • Title
    • Customize the text displayed in the upload field. Example: "Click or drag your image here to crop."
  • Form ID
    • Add a unique identifier if you want to associate the element with a specific form.
  • Image Source
    • Static Image: Set up a default image, such as a logo or placeholder.
    • Dynamic Image: Use an image stored dynamically, such as one from your database.
    • External Sources: Allow users to upload images from external sources.Example: "Search for free images."
  • Disable Upload
    • Check this option to disable the image upload functionality if needed.
    • Element β†’ CropUpload.
      Element β†’ CropUpload.
  1. Configure workflows for interactivity
    1. In the workflow editor, set up events and actions to customize the behavior of the CropUpload element.
      Available Events
      • A CropUpload Done
        • This event is triggered when the image upload or cropping process is successfully completed.
        • Save the cropped image URL to your database.
        • Display the cropped image in another element.
      • A CropUpload Error
        • This event is triggered when an error occurs during the cropping or upload process. Example:
        • Show an alert notifying the user of the error.
      Available Actions
      Add buttons or other interactions in your app to control the CropUpload element's behavior using the following actions:
      • Reset A CropUpload
        • Resets the element to its initial state, removing the uploaded image.
          • Action β†’ Reset A CropUpload.
            Action β†’ Reset A CropUpload.
      • Unload A CropUpload
        • Removes the uploaded image from the element.
          • Action β†’ Unload A CropUpload.
            Action β†’ Unload A CropUpload.
      • Rotate A CropUpload
        • Adds rotation functionality. You can specify the angle to rotate the image.
          • Action β†’ Rotate A CropUpload.
            Action β†’ Rotate A CropUpload.
      • Save A CropUpload
        • Saves the cropped image and generates a usable URL to store in the database or display in another element.
          • Action β†’ Save A CropUpload.
            Action β†’ Save A CropUpload.
      • ScaleX A CropUpload and ScaleY A CropUpload
        • Scales the image horizontally or vertically.
        • Action β†’ ScaleX A CropUpload.
          Action β†’ ScaleX A CropUpload.
          Action β†’ScaleY A CropUpload.
          Action β†’ScaleY A CropUpload.
      • SetType A CropUpload
        • Sets the file type of the cropped image, such as JPG or PNG.
          • Action β†’ SetType A CropUpload
            Action β†’ SetType A CropUpload
      • ConstrainProportions A CropUpload
        • Enables or disables proportional constraints to maintain the original aspect ratio of the image.
          • Action β†’ ConstrainProportions A CropUpload
            Action β†’ ConstrainProportions A CropUpload

Plugin Element Properties

CropUpload

Element properties.
Element properties.
Fields:
Title
Description
Type
Title
Text will be displayed in the element when no image is shown
Text
Form id
Unique ID of the element
Text
Image source
Image to crop
Image (optional)
Disable upload
Check the box to disable user image upload. If checked, the title will not be displayed.
Checkbox (yes/no)

Element Actions

  1. constrainProportions - left both fields empty to switch off
    1. Workflow Action: constrainProportions
      Workflow Action: constrainProportions
      Title
      Description
      Type
      Ratio
      Ratio of the width and height for the cropping area. Used to constrain the proportions of the cropped area.
      Number (optional)
      Ratio_str
      β€˜Free’ or W:H format
      Text (optional)
  1. reset - Resets the cropping tool to its original state, clearing any adjustments made on the image.
    1. Workflow Action: reset.
      Workflow Action: reset.
  1. unload - Unloads the current image from the cropping tool and clears any existing settings.
    1. Workflow Action: unload.
      Workflow Action: unload.
  1. rotate - Rotates the image by a specified number of degrees.
    1. Workflow Action: rotate.
      Workflow Action: rotate.
      Title
      Description
      Type
      Degrees
      The number of degrees to rotate the image. Positive values rotate clockwise, while negative values rotate counterclockwise.
      Number
  1. save - Saves the cropped image with specified dimensions, or uses the original dimensions if not provided.
    1. Workflow Action: save.
      Workflow Action: save.
      Title
      Description
      Type
      Width
      (Optional) When Provided Specifies the dimensions (in pixels) of the resulting cropped canvas. When Empty The canvas dimensions match the exact size of the cropped area in the original image (no scaling).
      Number (optional)
      Height
      (Optional) When Provided Specifies the dimensions (in pixels) of the resulting cropped canvas. When Empty The canvas dimensions match the exact size of the cropped area in the original image (no scaling).
      Number (optional)
  1. scaleX - Scales the image horizontally by a specified factor.
    1. Workflow Action: scaleX.
      Workflow Action: scaleX.
  1. scaleY - Scales the image vertically by a specified factor.
    1. Workflow Action: scaleY.
      Workflow Action: scaleY.
  1. setType - Sets the type of the crop area to either "Rect" for a rectangular crop or "Ellipse" for an elliptical crop.
    1. Workflow Action: setType.
      Workflow Action: setType.
      Title
      Description
      Type
      Type
      Rect or ellipse
      Text

Exposed states

Title
Description
Type
Url
The URL of the image being cropped. This state holds the image source URL.
Text
Error
Displays any error messages encountered during the image cropping or loading process.
Text
Loaded
Indicates whether the image has been successfully loaded into the cropping tool. If true, the image is ready for cropping.
Checkbox (yes/no)

Element Events

Title
Description
done
Triggered when the image has been successfully cropped and saved. This event occurs after the crop operation is completed.
error
Triggered when an error occurs during the cropping process, such as an invalid image format or an issue with loading the image.
Image without caption

Changelogs