How to add an width 100% image to java emal MimeBodyPart? - jakarta-mail

Because I have a really wide image but the MimeBodyPart seems is limiting the image width. I want my image width 100%.

MimeBodyPart has nothing to do with this. It's all up to the mail reader you're using how it chooses to display html body parts. Most mail readers will limit the html you can use in a mail message.
You might find this table of css support in mail readers helpful.

Related

Uploading image to database

I stumbled upon a problem during my work with codename one and the parse4cn1 plugin.
I try to upload an image which I took with the capture module of codename one. According to the documentation of parse4cn1 I have to convert the image into “Bytes” with the “getBytes” function. But according to the Codename one documentation getBytes only works with Strings and not with images.
Do you know how to “convert” the image appropriately?
I have been using this documentation, the section "uploading files":
https://github.com/sidiabale/parse4cn1/wiki/Usage-Examples#uploading-files
getBytes() is a method of EncodedImage not image. An encoded image can map to a PNG or JPEG and is a subclass of Image. You can use EncodedImage.create*() methods to load an EncodedImage directly or convert an existing image to an EncodedImage:
EncodedImage e = EncodedImage.createFromImage(img, false);
The second argument indicates if this should become a PNG or JPEG. If the image includes transparent/translucent pixels use PNG. If the image is a photo use JPEG.

codename one Resize Image quality

My requirement is to show the small image into the bigger one at the same quality. I have tried setting the background image to the container, scaleImageLabel, ImageViewer by doing so I can achieve the required size but the quality is not good.
using cloudinary is the only option to go with or if there is any other option available.
Following code has been used.
ImageViewer iv = new ImageViewer();
iv.setImageInitialPosition(IMAGE_FIT);
iv.setPreferredH(Display.getInstance().getDisplayHeight() / 2);
iv.setImageNoReposition(vi.img);
Need to remove the blank space top and bottom
while using IMAGE_FILL image has been croped

Orientation error for images uploaded to GAE (GCS + get_serving_url)

We are developing an image sharing service using GAE. Many users have reported since last week that "portrait images are oriented in landscape".
We found out that from a specific timing, the specification of images uploaded and distributed through GAE has changed.
So the specs seem to have changed around 3/18 03:25(UTC) .
The "orientation" of Exif is not properly applied.
We are using GAE/Python. We save images uploaded by the users to GoogleCloudStorage, then use the URL we get with get_serving_url to distribute them.
Is this problem temporal?
Also, is it possible to return to the specs before 3/18 03:22(UTC)?
I think it happens because when get_serving_url service resize the image, it always resize the image from the longest side of the Image, keeping the aspect ration same. If you have a image of 1600x2400, then the resize image is 106x160 to keep the aspect ratio is same.
In your case one of the image is 306x408 (which is correct)as Image is resized from the height, and the other image is 360x270 (in which orientation change) the image is resized from width. I think in the later-one the orientation is changed just to keep the aspect ratio same.

Responsive Websites with "cover" background images

I'm designing a responsive site using edge reflow with the following rules for breakpoints:
<480px, <768, 1024>
I'm using a different background picture for each breakpoint of respective widths. However when I add them to Reflow with contain for scale-x it seems as if the image I created is not that size. Most of them were at least 200 pixels shorter than designed.
So my question is what dimensions should I use background images for each breakpoint as well as any other guidance for this using Reflow or suggestions of I'm doing something wrong.
Normally I'd use cover rather than contain but then the image scales and doesn't show what I need it to from device to device.
Thanks

Download full size image link in drupal 7 gallery

I've created a little gallery in drupal 7 using views module and colorbox formatter for image field. The thing is, I'd like to provide url for full size image download. Mind You - "full size image" is not the same image that appears in colorbox overlay. In fact I don't have full size image at all, since I've limited max image dimension on upload (1000 x 1000px). And I'm not sure how to overcome this restriction.
So, user should be able to click on a thumbnail (100 x 100px) and view 1000px wide version of an image in colorbox overlay. And apart from that there should be download link to full size photo (4000px wide, for example) - preferably in an overlay, but may be on the gallery page as well.
I could just skip size limits on upload and pull the link from image src, but I wanted to save bandwith and speed up display. Well, creating a gallery full of 16 Mpx photos isn't the way to go, anyway.
Is there any clever way to achieve what I want, or do I just need to hack file upload module a bit?
Ok, I've found an answer. And it's pretty simple, now that I think of it.
Since image derivatives are created on the fly, I just needed to create another image style in admin/config/media/image-styles, 1000px wide and high, and remove upload limit in image field.
"Full size download link" may be then created by a regex in JS, just replace one path to image with another.

Resources