app/controllers/posts_controller.rb
## takes a saved Image object, returns the markdown content to refer to the image
takes a saved Image object, returns the markdown content to refer to the image
takes a saved Image object returns the markdown content to refer to the image
def process_new_image(image)
    blob_path = path_for(image.blob)
    image_meta = ActiveStorage::Analyzer::ImageAnalyzer.new(image.blob).metadata
    if image_meta[:width] > 1600 
      return "\n\n<a href=\"#{image_path(image)}\">\n  <img src=\"#{image_resized_path(image)}\"></img>\n</a>"
    else 
      return "\n\n<img src=\"#{image_path(image)}\"></img>"
    end
  end
def process_new_image ( image ) blob_path = path_for ( image . blob ) image_meta = ActiveStorage :: Analyzer :: ImageAnalyzer . new ( image . blob ) . metadata if image_meta [ :width ] > 1600 return "\n\n<a href=\"#{image_path(image)}\">\n  <img src=\"#{image_resized_path(image)}\"></img>\n</a>" else return "\n\n<img src=\"#{image_path(image)}\"></img>" end end
takes a saved Image object, returns the markdown content to refer to the image
takes a saved Image object returns the markdown content to refer to the image
#resize at lower quality with link #simple full image
image
<not_specific>