Cropping center square of UIImage

I think here would be the perfect solution! It is NOT good idea to crop image basis on the toSize‘s size. It will look weird when the image resolution (size) is very large. Following code will crop the image as per the toSize‘s ratio. Improved from @BlackRider‘s answer. – (UIImage *)imageByCroppingImage:(UIImage *)image toSize:(CGSize)size { double … Read more

Java: How do I create a movie from an array of images?

The solution seems to be to use Mencoder (or at least, that seems to be a semi-popular choice). Here’s a link that specifically addresses images-to-movies capabilities in Mencoder. As for rendering text onto the frames before encoding them as part of the video, you can use Java2D’s image manipulation libraries to simply draw text on … Read more

Converting PDF to images automatically

If the PDFs are truly scanned images, then you shouldn’t convert the PDF to an image, you should extract the image from the PDF. Most likely, all of the data in the PDF is essentially one giant image, wrapped in PDF verbosity to make it readable in Acrobat. You should try the simple expedient of … Read more

ASP.NET Image uploading with Resizing

Once the file has been saved to the server you can use code like this to resize. This code will take care of length/width ratio on the resize. public static Bitmap CreateThumbnail(string lcFilename, int lnWidth, int lnHeight) { System.Drawing.Bitmap bmpOut = null; try { Bitmap loBMP = new Bitmap(lcFilename); ImageFormat loFormat = loBMP.RawFormat; decimal lnRatio; … Read more

django – pisa : adding images to PDF output

I got the images working. the code is as follows: from django.http import HttpResponse from django.template.loader import render_to_string from django.template import RequestContext from django.conf import settings import ho.pisa as pisa import cStringIO as StringIO import cgi import os def dm_monthly(request, year, month): html = render_to_string(‘reports/dmmonthly.html’, { ‘pagesize’ : ‘A4’, }, context_instance=RequestContext(request)) result = StringIO.StringIO() pdf … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)