Created
October 30, 2022 22:33
-
-
Save michalkorzawski/510e24a48c66cf90143ab569601cb654 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/controllers/images_controller.rb | |
class ImagesController < ApplicationController | |
skip_before_action :verify_authenticity_token, only: :convert_heic | |
def convert_heic | |
tempfile = ImageConverter.new(tempfile: params[:image].tempfile, height: 400).call | |
render json: tempfile.read, content_type: 'image/jpg' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment