Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8915263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:56:05+00:00 2026-06-15T04:56:05+00:00

I have a Rails 3 app with images hosted on AWS S3 and managed

  • 0

I have a Rails 3 app with images hosted on AWS S3 and managed by the Paperclip gem.

I’m trying to set it up so that a user can edit those image in-browser using a js library (right now I’m using Pixastic, but I’m open to trying Caman) but run into a problem where the js image manipulation libraries fail because of CSRF protections from the browser that reject the S3 image as being from a different domain.

Is there some way to proxy the images so that they appear to be coming from the same domain, or otherwise work around this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T04:56:06+00:00Added an answer on June 15, 2026 at 4:56 am

    I just spent a day with a partner working through this with CamanJS.

    Without knowing how you’re constructing your view (and not knowing Pixastic at all) I’ll do my best to answer.

    Assuming you’re linking to the original image in your html, add crossorigin='anonymous' into the image tag:

    <img class='image' crossorigin='anonymous' data-camanheight='450' src=<%= @photo.url%>>

    This will set up the browser’s expectation that the image will not come from your site’s url.

    We found this to work for the initial image, but when CamanJS’ revert() function reconstructs the image (before converting it back to a canvas element), it leaves out the header information that lets the browser know that it’s ok that it is cross-origin data. So every time we reverted an image, we hit a CORS issue again. I looked through Pixastic’s docs briefly, but can not advise you on whether or not you’ll have a similar issue.

    NOTE: A super fluid experience was our priority, and we didn’t want to set up a proxy, so our work-around was to keep a clone of the image tag on hand in a Javascript variable and write our own method to revert the canvas, re-cloning the the image tag, pushing one of the cloned tags into the DOM and then converting it to a new canvas element and getting rid of the old one. It ran into some CamanJS specific behaviors that made it a little ‘hacky.’

    My partner on the project has submitted a pull request to CamanJS that retains the header info, so this may be resolved soon, making CamanJS a better solution for cross origin resource sharing.

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Rails app that archives high-res images (and thumbs) on S3 (via
I have a simple rails app and i use paperclip gem for my image
So I have a Rails 3 app using Paperclip to crop images. I have
I have a rails app that users can upload photos to. The photos get
I have a Rails app where users can upload images. After they upload an
I have a Rails app that uploads images for image processing, and I want
I have a Rails 3 app with Paperclip gem. Actually, my local directories structure
I have a simple rails app that stores images created by users in an
I have a Rails 3.2 app where a user clicks an image to select
I have a Rails app running Mongoid on Heroku and I need to set

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.