thumbnails

PHP: Creating cropped thumbnails of images, problems

99封情书 提交于 2019-12-08 12:21:05
问题 I am fairly new to PHP, and I am writing a script that will resize images. First an uploaded image is resized to 800width by *height, depending on the orientation of the file uploaded (portrait/landscape). The script is then meant to create a thumbnail of that image. The thumbnail must be 175width by 117height. This is has the same proportion as a standard jpeg image from the cameras that take the pictures, thus there is no need to crop the image for a thumbnail version if the original file

CSS clip property - is there an alternative for cropping images?

淺唱寂寞╮ 提交于 2019-12-08 08:39:01
问题 I have an image gallery and I want the thumbnails to be cropped at 150px x 150px. The images aren't square - they are rectangular and all different sizes, so I can't set the width and height to 150px because the images will be all squashed and distorted. I'm wondering what other methods there are to do cropping for thumbnails apart from the CSS clip property. Are there any other CSS solutions or perhaps jQuery scripts? 回答1: You can use negative margins to achieve this. DEMO <p class="crop">

Assigning thumb to fancybox's url (image)

六月ゝ 毕业季﹏ 提交于 2019-12-08 06:26:20
问题 This comes after "Direct link to any fancybox", but with URL in address bar. Now that I managed to assign an unique url to each image of my fancybox gallery, I was wondering if by sharing e.g. image #1 url, it would outcome the correct thumb, for example, on Facebook. I'm using the latest fancybox and jquery versions. Here is the Javascript: var thisHash = window.location.hash; $(document).ready(function() { $('.thumbs').fancybox({ prevEffect : 'fade', nextEffect : 'fade', closeBtn : true,

create fixed size thumbnail dynamically on listview control

断了今生、忘了曾经 提交于 2019-12-08 06:03:51
问题 how to create fixed size thumbnail dynamically and resize image in listview best fit the size of the thumbnail. private void Treeview1_AfterSelect(System.Object sender, System.Windows.Forms.TreeViewEventArgs e) { if (folder != null && System.IO.Directory.Exists(folder)) { try { DirectoryInfo dir = new DirectoryInfo(@folder); foreach (FileInfo file in dir.GetFiles()) { try { imageList.ImageSize = new Size(136, 136); imageList.ColorDepth = ColorDepth.Depth32Bit; Image img = new Bitmap(Image

Thumbnail the first page of a pdf from a stream in GraphicsMagick

独自空忆成欢 提交于 2019-12-08 05:47:15
问题 I know how to use GraphicsMagick to make a thumbnail of the first page of a pdf if I have a pdf file and am running gm locally. I can just do this: gm(pdfFileName + "[0]") .background("white") .flatten() .resize(200, 200) .write("output.jpg", (err, res) => { if (err) console.log(err); }); If I have a file called doc.pdf then passing doc.pdf[0] to gm works beautifully. But my problem is I am generating thumbnails on an AWS Lambda function, and the Lambda takes as input data streamed from a

Image Thumbnails ASP.NET

回眸只為那壹抹淺笑 提交于 2019-12-08 04:55:13
问题 I'm trying to genererate thumbnails from image files stored in a folder under the website root, I am currently using the built in capebilites in .NET to dynamically generate the thumbnails but the quality gets quite bad and since its an webshop thats a real problem my question is if there is any good (open source?) frameworks that can help me hanlde the image thumbnail creation and rezise and possible help with image file size compression during upload? I've looked but havent found any yet?

Thumbnails for mxml components in Flex

百般思念 提交于 2019-12-08 04:31:37
问题 Is it possible to make some kind of 'dynamic' thumbnails for mxml components which I'm using in my application? By 'dynamic' I mean if I change some layout in mxml component, my thumbnail refreshes according to new layout without any screen capturing, photoshoping or similar =) Edit: I am using a FlexBook component, which makes a 'book' of mxml components (because each page has many independent interactions). I think that problem could be that bitmap data does not exist until I actually start

need help solving sorl-thumbnail error: “'thumbnail' is not a valid tag library:”

一曲冷凌霜 提交于 2019-12-08 03:15:28
问题 I've been pulling my hair out trying to solve this problem and I've tried everything and I have no ideas left. I keep seeing this error: Exception Value: 'thumbnail' is not a valid tag library: Could not load template library from django.templatetags.thumbnail, No module named sorl.thumbnail.main $DJANGO_PACKAGES/sorl/thumbnail/main.py DOES exist. Here's what I did to setup, downloaded latest sorl-thumbnail and added its location to the python path in .bash_profile included 'sorl.thumbnail'

Thumbnail the first page of a pdf from a stream in GraphicsMagick

只愿长相守 提交于 2019-12-07 15:39:26
I know how to use GraphicsMagick to make a thumbnail of the first page of a pdf if I have a pdf file and am running gm locally. I can just do this: gm(pdfFileName + "[0]") .background("white") .flatten() .resize(200, 200) .write("output.jpg", (err, res) => { if (err) console.log(err); }); If I have a file called doc.pdf then passing doc.pdf[0] to gm works beautifully. But my problem is I am generating thumbnails on an AWS Lambda function, and the Lambda takes as input data streamed from a source S3 bucket. The relevant slice of my lambda looks like this: // Download the image from S3,

addField type image and thumbnail path

别来无恙 提交于 2019-12-07 15:20:56
问题 I have a Magento webshop and just created a custom module with the extension (Modulecreator). This module comes with a standard admin interface that can handle file uploads. I found out that if you want to show thumbnails you can use the 'image' field type (addField('myfield', 'image')) instead of the 'file' type field. But now i've got a problem. When I upload files, I save them in a subdirectory called 'slides' in the 'media' directory. But when I edit the item, the image path for the