thumbnails

Generate a thumbnail of a Word document

可紊 提交于 2019-12-18 13:25:08
问题 I have a website where users upload Word documents and I want to display thumbnails of these word documents. If anyone of you knows how to display the first page of a Word file as an image using C# please tell me. Also if you know a trusted .NET library to convert word files to images that requires no office interop that would be great. 回答1: Take a look at this article. It's in VB, but it lets you extract the thumbnail image that Windows Explorer uses for Office documents and regular images.

Use PHP to create thumbnails. (Cropped to square)

℡╲_俬逩灬. 提交于 2019-12-18 12:41:00
问题 I have a php script im currently using that creates thumbnails based on a max width and height. However, I'd like it to always create square images and crop the images when needed. Here is what I'm using now: function makeThumb( $filename, $type ) { global $max_width, $max_height; if ( $type == 'jpg' ) { $src = imagecreatefromjpeg("blocks/img/gallery/" . $filename); } else if ( $type == 'png' ) { $src = imagecreatefrompng("blocks/img/gallery/" . $filename); } else if ( $type == 'gif' ) { $src

Magento resize() image quality: dirty white background

99封情书 提交于 2019-12-18 11:56:11
问题 I have a client who is seriously unhappy with the way their product thumbnails are rendering on Magento. The dodgy appearance is noticeable on two accounts: there is a dirty white background which has very light grey horizontal lines and secondly there is ever so slight color loss (loses contrast and saturation). I have removed ALL compression, set ALL quality to 100%, flushed image cache, experimented, broken, and fixed it all dozens of times, and nothing seems to work. This version of

Efficiently generating thumbnails with ImageMagick and convert

◇◆丶佛笑我妖孽 提交于 2019-12-18 10:56:07
问题 I'm looking to efficiently generate various sized thumbnails with ImageMagick's convert utility in Python. Some of my image files are quite large (~15MB JPGs). One way I could do it would be to take the full-sized image, and to generate the various thumbnails from the full-sized image, as follows: convert sample_image.jpg -resize 1024x768 sample_image-1024x768.jpg convert sample_image.jpg -resize 800x600 sample_image-800x600.jpg convert sample_image.jpg -resize 400x300 sample_image-400x300

Efficiently generating thumbnails with ImageMagick and convert

守給你的承諾、 提交于 2019-12-18 10:56:03
问题 I'm looking to efficiently generate various sized thumbnails with ImageMagick's convert utility in Python. Some of my image files are quite large (~15MB JPGs). One way I could do it would be to take the full-sized image, and to generate the various thumbnails from the full-sized image, as follows: convert sample_image.jpg -resize 1024x768 sample_image-1024x768.jpg convert sample_image.jpg -resize 800x600 sample_image-800x600.jpg convert sample_image.jpg -resize 400x300 sample_image-400x300

PIL: Thumbnail and end up with a square image

邮差的信 提交于 2019-12-18 10:01:39
问题 Calling image = Image.open(data) image.thumbnail((36,36), Image.NEAREST) will maintain the aspect ratio. But I need to end up displaying the image like this: <img src="/media/image.png" style="height:36px; width:36px" /> Can I have a letterbox style with either transparent or white around the image? 回答1: Paste the image into a transparent image with the right size as a background from PIL import Image size = (36, 36) image = Image.open(data) image.thumbnail(size, Image.ANTIALIAS) background =

Pink/Reddish tint while resizing jpeg images using java thumbnailator or imgscalr

爱⌒轻易说出口 提交于 2019-12-18 06:12:37
问题 I am trying to convert an image (url below) using two libraries (thumbnailator and imgscalr. My code works on most of the images except a few which after conversion have a pink/reddish tint. I am trying to understand the cause and would welcome any recommendation. Note - Image type of this image is 5 i.e BufferedImage.TYPE_3BYTE_BGR and i am using Java 7 Using Thumbnailator Thumbnails.of(fromDir.listFiles()) .size(thumbnailWidth, thumbnailHeight) .toFiles(Rename.SUFFIX_HYPHEN_THUMBNAIL);

Carousel with Thumbnails in Bootstrap 3.0

ε祈祈猫儿з 提交于 2019-12-17 21:54:31
问题 I need to make Bootstrap 3.0 Carousel to display a slide of thumbnails. How can I do this? This is an image of what I´m looking for: This is a working example for Bootstrap 2, but I need this for Bootstrap 3.0.: Bootstrap Thumbnail Slider 回答1: Bootstrap 4 (update 2019) A multi-item carousel can be accomplished in several ways as explained here. Another option is to use separate thumbnails to navigate the carousel slides. Bootstrap 3 (original answer) This can be done using the grid inside

making jfilechooser show image thumbnails

送分小仙女□ 提交于 2019-12-17 19:01:57
问题 I wanted to create a JFileChooser with thumbnail view of image files.So I subclassed FileView and in the method which creates ImageIcon did some scaling sothat thumbnail images are shown. However,the overall effect is that, the filechooser widget takes some time before opening a directory and showing thumbnails..In createImageIcon() below,I need to call new ImageIcon() twice-once with the image filepath and next with the resized image as constructor argument.I think this is what slows the

Loading large images as thumbnails without memory issues in Java?

二次信任 提交于 2019-12-17 18:38:44
问题 I'm trying to let the user load images from their harddrive, and present these visually in the GUI as a list of thumbnails (JPanels with icons added to a JList). I'm currently using ImageIO.read() to get a BufferedImage and using getScaledInstance for each image (heard that you weren't supposed use that though). It works reasonably well with small images, but loading more than four photographs (5000x3000 or some such) and I get "java.lang.OutOfMemoryError: Java heap space". The reference to