-
Notifications
You must be signed in to change notification settings - Fork 647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Images not appearing when rendering a file from model #398
Comments
I don't see an image when I go to https://dx4d070bb134o.cloudfront.net/uploads/amber-dev/vehicle/avatar2/21/flyer_images__19_.jpeg, so neither can Is that path correct? I get a message that the DNS failed to find the server |
typo in host name... was typed as DUH! |
Looks like it works with http://, but not https |
that link I pasted works and it is https |
Great! 👍 Closing this issue. If something else comes up, feel free to reopen or comment. |
I was able to replicate your problem (rendering in the controller) with the https link. When i changed the link to using http, it rendered correctly |
yeah, the typo was not the issue, let me try http |
Using http works for me also Thanks, guys. |
FWIW, I can see the car at both http and https urls, if the https version isn't rendering for you through wicked_pdf, it might be because you need to update |
Yeah, I updated it last week to the current version after getting that same John Kropka On Tue, Mar 31, 2015 at 3:01 PM, David Jones notifications@github.com
|
switching to http in the carrierwave asset.host isn't an option for production because the server is serving https. but why would https image links work when rendering to html and not when rendering to a file? |
Because they need to be downloaded and rendered through the virtual web browser that What version of require 'open-uri'
def embed_remote_image(url, content_type)
asset = open(url, "r:UTF-8") { |f| f.read }
base64 = Base64.encode64(asset.to_s).gsub(/\s+/, "")
"data:#{content_type};base64,#{Rack::Utils.escape(base64)}"
end <%= image_tag(
embed_remote_image(
'https://dx4d070bbl34o.cloudfront.net/uploads/amber-dev/vehicle/avatar2/21/flyer_images__19_.jpeg',
'image/jpeg'
)
) %> |
I am using 0.12.2.1_osx-cocoa-x86-64 pkg, downloaded 3/26/2015 wkhtmltopdf 0.12.2.1 (with patched qt) |
This worked for me (embeded_remote_image suggestion) Thanks! John Kropka On Tue, Mar 31, 2015 at 3:31 PM, David Jones notifications@github.com
|
I am using this code in my model to generate a PDF
When I save the file, the images do not appear. I am debugging the code to show the URL for the image.
The text was updated successfully, but these errors were encountered: