-
Notifications
You must be signed in to change notification settings - Fork 58
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
Code breaks if image is large #11
Comments
@alekseyl I am a little confused with the issue that you are facing. Is it like you get a large image, preview it, crop it and the cropped image is not what you set in the preview? And you face this issue only for large images? |
I'm facing that problem too, I'll try my best to explain it successfully. The following works fine:This one is badly croppedBoth have the same dimensions (2560x1600), but while the first one is 3.5mb, the second one is just 1mb. My CoverUploader saves three versions of that image: the original, the include CarrierWave::RMagick
version :medium do
process resize_to_fit: [255, 9999]
end
version :cropped do
process crop: :cover
resize_to_fill 1140, 272
end Thank you in advance. |
Yes
Yes only XXL images faced that problem. And only if displayed for cropping image dimensions is smaller than original dimensions. |
Are you sure that crop is correct in first place? I've seen little differences between preview and cropped_result, so it may crop incorrectly but the result may be close to the one is expected. |
Actually the image I put before the cropped one is the original image. Which preview are you referring to? |
Hi
I have a problem with your solution: If image is too large it's get resized by jCrop or browser ( didn't get quite well who is doing it ) ( For example when I tried 3000x2000 actually I get something near 1700x1400 ). And as a result cropped area is not as I expected ( it's smaller than you see in preview ).
I have Ad and photo instead of User and avatar, and using MiniMagick, so my monkey patch looked like this:
I added photo_displayed_height and photo_displayed_width accessors to model which owns attachment, so I can store in it size of photo actually displayed in browser
added them to form:
The text was updated successfully, but these errors were encountered: