Skip to content

Commit

Permalink
,local_photo_path added to copy_to_local_file()
Browse files Browse the repository at this point in the history
  • Loading branch information
jywarren committed Jan 25, 2022
1 parent 9735504 commit 16d595c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/models/spectrum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def self.weekly_tallies

# finds the brightest row of the image and uses that as its sample row
def find_brightest_row
photo.copy_to_local_file(:original)
photo.copy_to_local_file(:original,local_photo_path)
image = Magick::ImageList.new(local_photo_path)
brightest_row = 0
brightest = 0
Expand All @@ -141,7 +141,7 @@ def find_brightest_row
def extract_data
pixels = []

photo.copy_to_local_file(:original)
photo.copy_to_local_file(:original,local_photo_path)
image = Magick::ImageList.new(local_photo_path)
# saved sample_row may be greater than image height, so temporarily compensate,
# but preserve sample_row in case we rotate back or something
Expand Down Expand Up @@ -280,7 +280,7 @@ def clone_calibration(clone_id)

# rotate clockwise
def rotate
photo.copy_to_local_file(:original)
photo.copy_to_local_file(:original,local_photo_path)
image = Magick::ImageList.new(local_photo_path)
image.rotate!(-90)
image.write('public' + photo.url)
Expand All @@ -289,7 +289,7 @@ def rotate

# horizontally flips image to match reversed spectrum, toggles 'reversed' flag
def reverse
photo.copy_to_local_file(:original)
photo.copy_to_local_file(:original,local_photo_path)
image = Magick::ImageList.new(local_photo_path)
image.flop!
image.write('public' + photo.url)
Expand Down

0 comments on commit 16d595c

Please sign in to comment.