Search Results

Search found 831 results on 34 pages for 'sorl thumbnail'.

Page 1/34 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • sorl-thumbnail unit tests fail by 1 pixel (!)

    - by stevejalim
    Hi I'm using sorl-thumbnail in a Django 1.2 (currently 1.2 RC) project and getting a surprising failure of four of sorl's built-in unit tests. Essentially, the resized images are all 1px shorter than the unit tests expect them to be. See below for details I'm developing on OSX 10.5.8 (not Snow Leopard) with Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12) and PIL 1.1.6. Any thoughts what might be up? Cheers Steve ====================================================================== FAIL: test_extension (sorl.thumbnail.tests.fields.FieldTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/django/myprojectnamehere/lib/sorl/thumbnail/tests/fields.py", line 66, in test_extension self.verify_thumbnail((50, 37), thumb, expected_filename) File "/usr/local/django/myprojectnamehere/lib/sorl/thumbnail/tests/base.py", line 92, in verify_thumbnail self.assertEqual(image.size, expected_size) AssertionError: (50, 38) != (50, 37) ====================================================================== FAIL: test_thumbnail (sorl.thumbnail.tests.fields.ImageWithThumbnailsFieldTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/django/myprojectnamehere/lib/sorl/thumbnail/tests/fields.py", line 111, in test_thumbnail self.verify_thumbnail((50, 37), thumb, expected_filename) File "/usr/local/django/myprojectnamehere/lib/sorl/thumbnail/tests/base.py", line 92, in verify_thumbnail self.assertEqual(image.size, expected_size) AssertionError: (50, 38) != (50, 37) ====================================================================== FAIL: testTag (sorl.thumbnail.tests.templatetags.ThumbnailTagTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/django/myprojectnamehere/lib/sorl/thumbnail/tests/templatetags.py", line 118, in testTag self.verify_thumbnail((90, 67), expected_filename=expected_fn) File "/usr/local/django/myprojectnamehere/lib/sorl/thumbnail/tests/base.py", line 92, in verify_thumbnail self.assertEqual(image.size, expected_size) AssertionError: (90, 68) != (90, 67)

    Read the article

  • Avoiding thumbnail name collisions with sorl-thumbnail

    - by Owen Nelson
    Understanding that I should probably just dig into the source to come up with a solution, I'm wondering if anyone has come up with a tactic for dealing with this. In my project, I have a lot of images being generated outside of the application. I'm isolating them on the filesystem based on a model's pk. For example, a model instance with a pk of 121 might have the following images: .../thumbs/1/2/1/img.1.jpg .../thumbs/1/2/1/img.2.jpg ... .../thumbs/1/2/1/img.27.jpg Since the image filenames themselves are not guaranteed to be unique, I'm looking for a way to inform sorl (at runtime) that I'd like to prefix thumbs for this model with the instance pk value. Is this even possible without patching sorl?

    Read the article

  • How To Get Web Site Thumbnail Image In ASP.NET

    - by SAMIR BHOGAYTA
    Overview One very common requirement of many web applications is to display a thumbnail image of a web site. A typical example is to provide a link to a dynamic website displaying its current thumbnail image, or displaying images of websites with their links as a result of search (I love to see it on Google). Microsoft .NET Framework 2.0 makes it quite easier to do it in a ASP.NET application. Background In order to generate image of a web page, first we need to load the web page to get their html code, and then this html needs to be rendered in a web browser. After that, a screen shot can be taken easily. I think there is no easier way to do this. Before .NET framework 2.0 it was quite difficult to use a web browser in C# or VB.NET because we either have to use COM+ interoperability or third party controls which becomes headache later. WebBrowser control in .NET framework 2.0 In .NET framework 2.0 we have a new Windows Forms WebBrowser control which is a wrapper around old shwdoc.dll. All you really need to do is to drop a WebBrowser control from your Toolbox on your form in .NET framework 2.0. If you have not used WebBrowser control yet, it's quite easy to use and very consistent with other Windows Forms controls. Some important methods of WebBrowser control are. public bool GoBack(); public bool GoForward(); public void GoHome(); public void GoSearch(); public void Navigate(Uri url); public void DrawToBitmap(Bitmap bitmap, Rectangle targetBounds); These methods are self explanatory with their names like Navigate function which redirects browser to provided URL. It also has a number of useful overloads. The DrawToBitmap (inherited from Control) draws the current image of WebBrowser to the provided bitmap. Using WebBrowser control in ASP.NET 2.0 The Solution Let's start to implement the solution which we discussed above. First we will define a static method to get the web site thumbnail image. public static Bitmap GetWebSiteThumbnail(string Url, int BrowserWidth, int BrowserHeight, int ThumbnailWidth, int ThumbnailHeight) { WebsiteThumbnailImage thumbnailGenerator = new WebsiteThumbnailImage(Url, BrowserWidth, BrowserHeight, ThumbnailWidth, ThumbnailHeight); return thumbnailGenerator.GenerateWebSiteThumbnailImage(); } The WebsiteThumbnailImage class will have a public method named GenerateWebSiteThumbnailImage which will generate the website thumbnail image in a separate STA thread and wait for the thread to exit. In this case, I decided to Join method of Thread class to block the initial calling thread until the bitmap is actually available, and then return the generated web site thumbnail. public Bitmap GenerateWebSiteThumbnailImage() { Thread m_thread = new Thread(new ThreadStart(_GenerateWebSiteThumbnailImage)); m_thread.SetApartmentState(ApartmentState.STA); m_thread.Start(); m_thread.Join(); return m_Bitmap; } The _GenerateWebSiteThumbnailImage will create a WebBrowser control object and navigate to the provided Url. We also register for the DocumentCompleted event of the web browser control to take screen shot of the web page. To pass the flow to the other controls we need to perform a method call to Application.DoEvents(); and wait for the completion of the navigation until the browser state changes to Complete in a loop. private void _GenerateWebSiteThumbnailImage() { WebBrowser m_WebBrowser = new WebBrowser(); m_WebBrowser.ScrollBarsEnabled = false; m_WebBrowser.Navigate(m_Url); m_WebBrowser.DocumentCompleted += new WebBrowserDocument CompletedEventHandler(WebBrowser_DocumentCompleted); while (m_WebBrowser.ReadyState != WebBrowserReadyState.Complete) Application.DoEvents(); m_WebBrowser.Dispose(); } The DocumentCompleted event will be fired when the navigation is completed and the browser is ready for screen shot. We will get screen shot using DrawToBitmap method as described previously which will return the bitmap of the web browser. Then the thumbnail image is generated using GetThumbnailImage method of Bitmap class passing it the required thumbnail image width and height. private void WebBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { WebBrowser m_WebBrowser = (WebBrowser)sender; m_WebBrowser.ClientSize = new Size(this.m_BrowserWidth, this.m_BrowserHeight); m_WebBrowser.ScrollBarsEnabled = false; m_Bitmap = new Bitmap(m_WebBrowser.Bounds.Width, m_WebBrowser.Bounds.Height); m_WebBrowser.BringToFront(); m_WebBrowser.DrawToBitmap(m_Bitmap, m_WebBrowser.Bounds); m_Bitmap = (Bitmap)m_Bitmap.GetThumbnailImage(m_ThumbnailWidth, m_ThumbnailHeight, null, IntPtr.Zero); } One more example here : http://www.codeproject.com/KB/aspnet/Website_URL_Screenshot.aspx

    Read the article

  • sorl-thumbnail: random name in Thumbnail field

    - by xRobot
    I want to use str(uuid.uuid4()) instead of the name uploaded. I have this model: class foo(models.Model): pic = ThumbnailField(upload_to='pics', size=(200, 200)) I am uploading hello_world.jpg and I should save these named versions should be saved for example in 4ba9b397-da69-4307-9bce-e92887e84d2f.jpg. How can I do that?

    Read the article

  • Create Custom Sized Thumbnail Images with Simple Image Resizer [Cross-Platform]

    - by Asian Angel
    Are you looking for an easy way to create custom sized thumbnail images for use in blog posts, photo albums, and more? Whether is it a single image or a CD full, Simple Image Resizer is the right app to get the job done for you. To add the new PPA for Simple Image Resizer open the Ubuntu Software Center, go to the Edit Menu, and select Software Sources. Access the Other Software Tab in the Software Sources Window and add the first of the PPAs shown below (outlined in red). The second PPA will be automatically added to your system. Once you have the new PPAs set up, go back to the Ubuntu Software Center and click on the PPA listing for Rafael Sachetto on the left (highlighted with red in the image). The listing for Simple Image Resizer will be right at the top…click Install to add the program to your system. After the installation is complete you can find Simple Image Resizer listed as Sir in the Graphics sub-menu. When you open Simple Image Resizer you will need to browse for the directory containing the images you want to work with, select a destination folder, choose a target format and prefix, enter the desired pixel size for converted images, and set the quality level. Convert your image(s) when ready… Note: You will need to determine the image size that best suits your needs before-hand. For our example we chose to convert a single image. A quick check shows our new “thumbnailed” image looking very nice. Simple Image Resizer can convert “into and from” the following image formats: .jpeg, .png, .bmp, .gif, .xpm, .pgm, .pbm, and .ppm Command Line Installation Note: For older Ubuntu systems (9.04 and previous) see the link provided below. sudo add-apt-repository ppa:rsachetto/ppa sudo apt-get update && sudo apt-get install sir Links Note: Simple Image Resizer is available for Ubuntu, Slackware Linux, and Windows. Simple Image Resizer PPA at Launchpad Simple Image Resizer Homepage Command Line Installation for Older Ubuntu Systems Bonus The anime wallpaper shown in the screenshots above can be found here: The end where it begins [DesktopNexus] Latest Features How-To Geek ETC Macs Don’t Make You Creative! So Why Do Artists Really Love Apple? MacX DVD Ripper Pro is Free for How-To Geek Readers (Time Limited!) HTG Explains: What’s a Solid State Drive and What Do I Need to Know? How to Get Amazing Color from Photos in Photoshop, GIMP, and Paint.NET Learn To Adjust Contrast Like a Pro in Photoshop, GIMP, and Paint.NET Have You Ever Wondered How Your Operating System Got Its Name? Create Shortcuts for Your Favorite or Most Used Folders in Ubuntu Create Custom Sized Thumbnail Images with Simple Image Resizer [Cross-Platform] Etch a Circuit Board using a Simple Homemade Mixture Sync Blocker Stops iTunes from Automatically Syncing The Journey to the Mystical Forest [Wallpaper] Trace Your Browser’s Roots on the Browser Family Tree [Infographic]

    Read the article

  • How to include high resolution version of thumbnail

    - by neak
    I'm running a tube site that has a thumbnail for each post/video (running via Wordpress, 500k posts). When I first created the thumbnails they were a fairly large size, around 640px in width each and because of that I was seeing a lot of traffic from Google Images. After streamlining the site and resizing all of the thumbnails down to 170px rather than scaling them down I'm worried that Google isn't going to rank the images as high as they would be at a larger resolution, so is there a way to include the higher res versions and serve them to be indexed instead of the smaller ones?

    Read the article

  • On-Demand thumbnail creation with django and nginx

    - by sharjeel
    I want to generate thumbnails of images on the fly. My site is built with django and deployed using nginx which serves all the static content and communicates with django/apache using reverse proxy. Right now, for every image in my site, I generate all required sizes of thumbnails on-hand and deliver them when required. The problem is that whenever I change the size of a thumbnail, I have to regenerate all of them (and they are tons). However now I'd like to generate the thumbnail the first time it is accessed and later on nginx would deliver the same file over n over. If I delete that thumbnail file because of lesser accesses, it should get generated automatically the next time. Thumbnails in my case also have watermarks which require some computation logic of my application so a webserver thumbnail module might not work very well. The size of the thumbnail can be embedded in the URL. So http://www.example.com/thumbnail/abc_320x240.jpg gets the 320x240 size of the thumbnail. The approach I'm looking right now is to let nginx lookup the file and if it doesn't exist, forward the query to my django application which would create the thumbnail and send either the response or a redirect string. However I'm not sure about the concurrency issues and any other issues which might pop up later. What is the appropriate way to achieve this?

    Read the article

  • Create Thumbnail from url like Digg

    - by user308213
    How I can create thumbnail from url. For example: Like Digg website, when I submit a link, Digg for me chose a Thumbnail from any images on that URL. Or like Facebook, when I submit a link, I can chose a thumbnail for that link. So, how i can do that with asp.net/C#. I just want create thumbnail (not Screen Shot of web page) Thanks so much.

    Read the article

  • Create Thumbnail from url like Digg in asp.net/C#

    - by user308213
    How I can create thumbnail from url. For example: Like Digg website, when I submit a link, Digg for me chose a Thumbnail from any images on that URL. Or like Facebook, when I submit a link, I can chose a thumbnail for that link. So, how i can do that with asp.net/C#. I just want create thumbnail (not Screen Shot of web page) Thanks so much.

    Read the article

  • Disable IE 8 Thumbnail Previews on Windows 7 Taskbar

    - by Asian Angel
    The Aero thumbnail previews are a great new feature, but if you are not a fan of the flashy eye-candy, you can get rid of them with a simple tweak. Here is how to do it. Before Here we are…Internet Explorer 8 with a lot of How-To Geek Network goodness ready to go. The Taskbar Thumbnail Previews look very nice, but perhaps they take up too much room for those of you who like to keep things simple. The Taskbar Icon has the classic “fanned edge” look just like any other software with Taskbar Thumbnail Previews active. Disabling the Thumbnail Previews If you want to deactivate the Taskbar Thumbnail Previews for Internet Explorer, it is quite easy and will only take you a few moments to complete. Open IE and go to Tools \ Internet Options. When the Internet Options Window opens you will already be on the General Tab. Under the Tabs Section, click on the Settings button. The Tabbed Browsing Settings window opens. Uncheck Show previews for individual tabs in the taskbar and click OK. When you are returned to the Internet Options Window, click OK once again to totally exit out. Note: A browser restart will be required for the changes to take effect. After you have restarted Internet Explorer, you will see the simple default Taskbar Thumbnail Preview and standard icon look. Conclusion If you have been looking to disable the Taskbar Thumbnail Previews for Internet Explorer, then you are only a few clicks away from satisfaction. If you want to change it back, it is as simple as re-enabling the Show previews for individual tabs in the taskbar setting. Similar Articles Productive Geek Tips Increase the size of Taskbar Preview Thumbnails in Windows 7Vista Style Popup Previews for Firefox TabsWorkaround for Vista Taskbar Thumbnail Previews Not Showing CorrectlyDisable Thumbnail Previews in Windows 7 or Vista ExplorerGet Vista Taskbar Thumbnail Previews in Windows XP TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips Acronis Online Backup DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows Fun with 47 charts and graphs Tomorrow is Mother’s Day Check the Average Speed of YouTube Videos You’ve Watched OutlookStatView Scans and Displays General Usage Statistics How to Add Exceptions to the Windows Firewall Office 2010 reviewed in depth by Ed Bott

    Read the article

  • Enable Thumbnail Previews for Firefox in Windows 7 Taskbar

    - by Asian Angel
    Are you tired of waiting for the official activation of Taskbar Thumbnail Previews in Firefox? See how easy it is to enable them now with a simple about:config hack. Note: We have briefly covered this before but present it here in a more detailed format. Before For our example we opened all of the websites in the HTG Network in tabs… When hovering over the Firefox Icon in the Taskbar, you only see the one thumbnail. There are two things in particular to notice here: 1.) The Tab Bar for Firefox is displayed with all four tabs visible in the Thumbnail Preview  2.) The “Taskbar Icon” itself is displaying as singular with no “fanned edge” on the right side. Hack the About:Config Settings To get the Thumbnail Previews working you will need to make a modification in the about:config settings. Type about:config in the Address Bar and press Enter. Unless you have previously disabled the warning you will see this message after pressing Enter. Click on the I promise! Button to finish entering the settings. In the Filter Address Bar either type or copy and paste the following about:config entry: browser.taskbar.previews.enable After you enter that in, you should see the entry listing as shown here. At this point there are two methods that you can choose to alter the entry. The first method is to right click on the entry and select Toggle and the second method is to double click on the entry. Both work equally well…choose the method that you like best. Once the about:config entry has been changed, you will need to restart Firefox for it to take effect. After restarting Firefox on our system the Thumbnail Previews were definitely looking very nice. Notice that the Tab Bar is no longer displayed in the Thumbnail Previews. The Taskbar Icon also had a “fanned edge” indicating that multiple tabs were open. Conclusion If you are tired of waiting for Mozilla to officially activate Taskbar Thumbnail Previews in Firefox, then you can go ahead and start enjoying them now. For more great Firefox 3.6.x about:config hacks read our article here. Similar Articles Productive Geek Tips Vista Style Popup Previews for Firefox TabsDisable IE 8 Thumbnail Previews on Windows 7 TaskbarIncrease the size of Taskbar Preview Thumbnails in Windows 7Workaround for Vista Taskbar Thumbnail Previews Not Showing CorrectlyDisable Thumbnail Previews in Windows 7 or Vista Explorer TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips VMware Workstation 7 Acronis Online Backup DVDFab 6 Revo Uninstaller Pro Cool Looking Skins for Windows Media Player 12 Move the Mouse Pointer With Your Face Movement Using eViacam Boot Windows Faster With Boot Performance Diagnostics Create Ringtones For Your Android Phone With RingDroid Enhance Your Laptop’s Battery Life With These Tips Easily Search Food Recipes With Recipe Chimp

    Read the article

  • Why does sorl.thumbnail ImageField fail in the admin?

    - by Mark0978
    I have code that looks like this: from sorl.thumbnail import ImageField class Gallery(models.Model): pass class GalleryImage(models.Model): image = ImageField(upload_to='galleries') In the admin: class GalleryImageInline(admin.TabularInline): model = GalleryImage class GalleryAdmin(admin.ModelAdmin): inlines = (GalleryImageInline,) If I use the sorl.thumbnail as above, it is impossible to add images in the admin. I get the validation error Enter a list of values. If I replace the sorl.thumbnail.ImageField with a plain django ImageField, everything works. If I want sorl.thumbnail to clean up the cache thumbnails, I need to use it in the model, but if I use it in the model, I can't seem to add any images to need thumbnails. Anyone else found and fixed this problem yet?

    Read the article

  • Youtube python: get thumbnail

    - by dkgirl
    Is there a simple way to get the default thumbnail from a youtube entry object gdata.youtube.YouTubeVideoEntry? I tried entry.media.thumbnail, but that gives me four thumbnail objects. Can I always trust that there are four? Can I know which is the default thumbnail that would also appears on the youtube search page? And how would I get that one? Or do I have to alter one of the other ones? When I know the video_id I use: http://i4.ytimg.com/vi/{{video_id}}/default.jpg so, it would also be helpful to get the video_id. Do I really have to parse one of the url's to get at the video_id ? It seems strange that they don't provide this information directly.

    Read the article

  • Disable Opera Thumbnail Previews on Windows 7 Taskbar

    - by Asian Angel
    If you are one of the people who does not care for the Taskbar Thumbnail Previews in Windows 7 then we have a quick and easy way for you to turn them off in Opera Browser. Before Here is our Opera Browser with four tabs full of HTG Network goodness… Hovering the mouse over the Taskbar Icon gives a nice preview of each tabs content. Looking closer you can see the fanned edge on the Taskbar Icon indicating that there are multiple tabs open. This is all good but what if you just want something simpler? Disabling the Previews If you want to disable the Taskbar Thumbnail Previews in Opera you will need to type opera:config in the Address Bar and press Enter. Once you have done that, you will see a condensed listing for all of Opera’s preferences. There is one Preference Category that we need to look for…User Prefs. Note: While a Quick Find Search could be conducted for the entry that needs to be modified, we have chosen to show the full method here. After scrolling down and finding the User Prefs category you will need to expand the section. Notice the size of the scrollbar in comparison with the screenshot above…there is quite a lot that you can look at and finesse in Opera if desired. Scroll down until you find the Use Windows 7 Taskbar Thumbnails entry. Uncheck the box but do not close the opera:config Tab yet…or your changes will not take effect. Scroll down once more until you reach the end of the User Prefs category and click Save. With this particular modification you will need to restart Opera after clicking OK. After restarting Opera the Taskbar Icon and Taskbar Thumbnail Preview will revert to the minimal Windows 7 default as shown here. You can see Opera’s Tab Bar in the thumbnail and the Taskbar Icon no longer has a “fanned edge”. Conclusion If you want to disable Opera’s Taskbar Thumbnail Previews on your Windows 7 system, then this quick modification will help get it sorted out in just a few moments. Similar Articles Productive Geek Tips Disable IE 8 Thumbnail Previews on Windows 7 TaskbarIncrease the size of Taskbar Preview Thumbnails in Windows 7Vista Style Popup Previews for Firefox TabsEnable Thumbnail Previews for Firefox in Windows 7 TaskbarWorkaround for Vista Taskbar Thumbnail Previews Not Showing Correctly TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips All My Movies 5.9 CloudBerry Online Backup 1.5 for Windows Home Server Snagit 10 VMware Workstation 7 10 Superb Firefox Wallpapers OpenDNS Guide Google TV The iPod Revolution Ultimate Boot CD can help when disaster strikes Windows Firewall with Advanced Security – How To Guides

    Read the article

  • Create thumbnail image for PDF in Java

    - by Shaggy Frog
    I'm looking for a Java library that will can take a PDF and create a thumbnail image (PNG) from the first page. I've already looked at JPedal, but its insane licensing fee is completely prohibitive. I am using iText to manipulate PDF files at the moment, but I believe it doesn't do thumbnail generation. I can use something like Ghostscript on the command line, but I'm hoping to keep my project all-Java if possible.

    Read the article

  • Wordpress thumbnail creation question

    - by Will Ashworth
    I'm trying to use Wordpress' built-in thumbnailing and image re-sizing in my Wordpress 2.9.2 installation. I'm trying to get various sizes (post listing/results 160x160 & "single.php" 618x150) and for some reason the single.php one works, but only half way. Not sure if I'm doing something wrong here. I have it working…sorta. I’m totally stuck and there seems to be a lack of documentation on the Codex for this feature so here goes. The small 160×160 thumbnail for article listings/search views works fine. It crops it, all’s groovy. The issue comes when I go to format the image for the single.php article details view. It crops, but then scales down even further for some reason. Screenshot: http://c1319072.cdn.cloudfiles.rackspacecloud.com/4-15-2010%204-56-46%20PM.png NOTE: every time I re-test this I’m completely deleting the image from the media section and re-uploading the image entirely. I also have the re-create thumbnails plugin so I know it’s not caching. Here is my code included in "functions.php". This will help in debugging. add_theme_support( ‘post-thumbnails’ ); set_post_thumbnail_size( 160, 160, true ); // Normal post thumbnails add_image_size( ’single-post-thumbnail’, 618, 150, true ); // Permalink thumbnail size

    Read the article

  • Create a thumbnail of a dwg in in a linux environment

    - by Kyle
    Creating a ruby on rails site that uses RMagick to create thumbnails for many types of images. RMagick cannot read dwg files however. I've tried a few things, looked into the Java library JDWGLib, which would probably allow me to write a converter, but it would be a total from the ground up solution, where I just need a thumbnail. Also considered using a viewer program to open the file in a remote X session and do a screen capture, however I'm not sure how I could ever guarantee that the viewer had completed opening when I took the screenshot. I'm not concerned with being able to manipulate the file other than to create the thumbnail. It is going to be used for commercial purposes, so any libraries used need to be compatible.

    Read the article

  • Create a thumbnail of a dwg in in a linux envrionment

    - by Kyle
    Creating a ruby on rails site that uses RMagick to create thumbnails for many types of images. RMagick cannot read dwg files however. I've tried a few things, looked into the Java library JDWGLib, which would probably allow me to write a converter, but it would be a total from the ground up solution, where I just need a thumbnail. Also considered using a viewer program to open the file in a remote X session and do a screen capture, however I'm not sure how I could ever guarantee that the viewer had completed opening when I took the screenshot. I'm not concerned with being able to manipulate the file other than to create the thumbnail. It is going to be used for commercial purposes, so any libraries used need to be compatible.

    Read the article

  • How can I stop sorl thumbnail from breaking with very long filenames?

    - by bitbutter
    I've noticed that when working with SORL thumbnail, sometimes a user will upload an image with a very long filename, longer than the varfield in the database can hold. The name gets truncated in the database and the project gives errors whenever the image is requested. Is there a smart and safe way to have django automatically truncate long filenames in sorl uploads (prior to saving them in the database) to prevent this sort of thing? As reference, here's how the relevant model from my current project looks: class ArtistImage(models.Model): artist = models.ForeignKey(Artist) position = models.IntegerField() image = ThumbnailField( thumbnail_tag='<span class="artistimagewrapper"><img class="artistimage" src="%(src)s" width="%(width)s" height="%(height)s"></span>', upload_to='uploaded_images/artistimages', size=(900,900), quality=100, options={'crop': 'center'}, extra_thumbnails={ 'small':{ 'size':(92,92), 'quality':100, 'options':{'crop': 'center'}, } } ) class Meta: ordering = ('image',) def __unicode__(self): return (u"%s" % self.image)

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >