Accessing EXIF data - plone

I'd like to use the EXIF data that comes in the photos that have been uploaded into a gallery. In particular, I like to be able to sort images in a plonetruegallery view of a folder or collection on the EXIF date the photo was taken. Googling tells me that the ATImage type did store the EXIF data, but I haven't seen anything more recently that uses it. Even if I could just get the image import to change the Created date to be that taken from the EXIF DateTimeOriginal then that would be great.
Has anyone else tried to achieve this?

As your use case is very narrow it is unlikely others have tried to do the same with Plone. Some general pointers:
Poke the orignal image data stored in ImageField using EXIF-py
https://github.com/ianare/exif-py
Misc. info about Archeypes image and file fields:
http://collective-docs.readthedocs.org/en/latest/content/archetypes/files.html

for iptc meta data (most image tools store both metadata) you can try http://pypi.python.org/pypi/unweb.iptc
it's a slick and modern solution using event-subscribers.
if you only have exif metadata you can re-use the code and do the same using exif-py

ATPhoto (http://plone.org/products/atphoto/) is extremely out of date, and you should not use it wholesale, but you could look at how it parses EXIF tags for inspiration (and code-reuse).

By default ATImage object inherits from imagetransform so they have a method called getExif(): https://github.com/plone/Products.ATContentTypes/blob/master/Products/ATContentTypes/lib/imagetransform.py#L87
Integration to gallery is up to you and should not be difficult than doing context/getExif in the caption and display the way you want.
The main issue with addons here is about performance and dependencies. Doing parsing with python, store, synchronize, a source of issue that is quite big IMO.
I have already try many python package promize to extract and structure exif without real working out of the box solution.

Related

Can I do data visualization with Drupal?

Basically i want it to import data from a SQL database and Display it as graphs. Having said that i also want it to be dynamic,responsive as in the users should have filtering options. Any leads would be definitely helpful.
Please note that i am just a beginner with drupal.
Yes, But I recommend you to work on your own framework. Or even you can use some data visualization framework
Maybe this one is useful for you if you want to do it on your own:
http://www.sitepoint.com/twelve-javascript-libraries-data-visualization/
Why do you need Drupal for that?
I would make some PHP script which would read SQL and generate image out of that data, by using GD or ImageMagic lib. I guess you know that PHP can shoot out image file header and dynamically generate image, on fly. That PHP script could also read filter parameters to have influence on generated image.

Thumbnail extraction from videos using Qt/C++

how to get thumbnail image from the video file using Qt/C++.i use TagLib ,its not worked out.
You can use the libVLC or ffmpeg, it's more easily than using Qt
Basically any Video is in 'frame' and that frame is you thumbnail.
We can image like box, where inside of box are all information about 'image' like where is positioned (in time), how big it is (Full HD, 720 ...), and all other sort of information.
Biggest question is what video format you like to extract, and how you like to extract.
For example file format like AVI is well known see:
how to read avi files
In case when you read som other format, you need to know how to read correctly in binary format, or you can use any library that will handle 'unpack format' for you.
Last question is if library can 'extract' image for 'this' frame ... but this is up to library.
To answer your question, you can use any external library, or read manually by yourself on binary level.
PS: If TagLib is not working for you can try any other library, just make sure you read documentation and try to find is library allow you to get images from frames.

Creating a JPEG and writing its EXIF data in Flex

I am creating an application that takes a user's hand signature, input on the Blackberry playbook. When the JPEG is created, I would like to add Exif data such as the date/time to the JPEG. Does anyone know how to do this, or if it is possible?
Thanks
Phil
I couldn't find anything online about writing exif data, but I did find this interesting article on reading exif data. It mentions what bytes does what. I suggest you take that library to create something to write exif data. Seems fairly simple, just need to set the proper tags in the ByteArray, append the image byte array between 2 tags and write to the file.
i found two libries
As3 seems to be writing it to xml, but flash builder does not take in import com.adobe.xmp.*;
Metaphile

Use an excel template and update it programatically

I found this tool but I wonder if it still the right way nowdays with net 4.0 or is there any straight forward oob alternatives.
I just need to add columns and update excel stuff programatically. There are many ways but I need to keep the original document as a template. The link above explains exactly what the requeriments are and why they created such "ExcelPackage" library.
A quick look at the link you provided seems like it will in fact keep the original template intact and just return a populated version of that template. This is a pretty common way to create and populate Excel documents using Open XML since it helps to minimize the amount of code you have to write. If you did not specify the layout, styles, formats, etc in a template you would be forced to define those when coding and that could lead to some bloated code. Overall, a project like this or using the Open XML SDK 2.0 to create the documents is the way to go.

In ASP.NET what is the best way to convert a PDF file to HTML?

What my users will do is select a PDF document on their machine, upload it to my website, where I will convert into an HTML document for display on the website. The document will be stored in a database after conversion.
What's the best way to convert a PDF to HTML?
I have been handed a requirement where a user would create a "news" story as a pdf and then would upload it to the sever, where it will be converted to HTML and displayed on the website.
Any document creation software that can save documents as PDF can save them as HTML. I'm assuming the issue is that your users will be creating rich documents (lots of embedded images), which results in multiple files, and your requirements stem from a desire to make uploading these documents as simple as possible to the user.
There are numerous conversion packages that can probably do this for you, however when you're talking about rich content, you are talking about text plus images. Those images have to be stored somewhere and served somehow, and whatever conversion method you use will require you to examine all image sources to make sure they point to valid locations on your server.
I would like to suggest an alternate way of doing this that you can take to your team: Implement one of the many blog APIs for publishing content. There are free and commercial software packages that use these APIs to publish content directly to a website, such as Windows Live Writer and Microsoft Word. Your users can simply create their content and upload it directly to your website without having to publish it as PDF first then upload it. So the process becomes much smoother for your users, and you get the posts in a form that doesn't require you spend thousands of dollars on developing or buying conversion code.
The two most common APIs are the MetaWeblog API and the Movable Type API. Both are very simple and easy to implement. I think this way would be a MUCH better alternative than what you're thinking about doing.
I don't think converting a PDF to an HTML string is necessarily the best idea, especially if you want to export it back as PDF. PDF files often contain binary elements such as images, so you may be best to convert it to ASCII via an encoding, such as Base64. That way you will have an ASCII string you can save into a text field in the DB and then convert it back out. Could you expand more on the main requirement?
My recommendation would be to not do it that way IF POSSIBLE (but we all know what managers are like) so...
I would recommend that you stay away from converting the PDF to/from HTML (because unless you can find a commercial solution it will be nigh on impossible) and instead do as has already been mentioned and store it as an encoded Base64 string, or BLOB or some other binary format in the database, and then display it to the user with some sort of PDF view plugin for the browser.
All it took was a simple google search for "PDF to HTML": http://www.gnostice.com/pdf2manyOverview_x.asp. I'm sure there are others.
So while it's 'possible', you may want to explain to your manager that this isn't the best content management solution.
Why not use the iTextSharp to read the PDF content? Then You could save both the binary PDF and the text content to the database. You could then let users search the content and download the PDF.
You should look into DynamicPDF. They have a converter (currently Beta) out for serving exactly this purpose. We have used their products with great success (especially for dumping Reporting Services reports directly to PDF).
Ref: http://www.dynamicpdf.com/

Resources