Get information about pics and video files with qt - qt

Well i have a project in which gets pics and videos from folders and also i can view them it it and when i view them i want to also see those tags kinda like the camera which took it, dimensions , the ISO, the exposure time and others for pics and camera model framerate and dimensions...
Thanks in advance

I've never seen anything like this in Qt. Anyway, Qt is a C++ framework, you can use whatever library you want to use. QImageMetaData and QMeta are very near Qt style, but can only be used for images (never tried those).
Anyway, I would use the XMP toolkit. You also mentioned videos, so in that case XMP can handle both. It is very simple to use, well documented and fast (license is BSD). It is written in C++, so you can port it on whatever platform you want.

I think Qt itself does not provide a way to extract exif data (which is what I guess you're trying to extract). You could perhaps try QMeta. I have not used this myself, so no guarantees.

Related

Should I use Qt Widgets or Qt Quick to develop a rich text editor?

I am new to Qt in general, and I have been playing with it to get to learn about it since I have to develop a very specific text editor.
I want to know if anyone could help me understand which one is better (or the most indicated) for the development of a rich text editor. I have worked before with C and C++ but Qt Widgets seems like a very step hill for the time being and I am completely new to javascript in general.
Some of the settings that I would need to implement on the text editor for better context are:
Look for the user to be always connected to internet.
Transfer and receive data from another program.
Grant read only to the opened files and then permission to write on them when a button is clicked.
Has to work on linux and windows.
Needs to look great.
My context:
So far I have done a few little applications and even a little rich text editor on Qt Widgets, but since I was having problems with the GUI implementation that I wanted, I started looking for a way to solve it and found that Qt Quick might be the solution.
I have been trying Qt Quick, and for now on looks great, but I do not know if it has the capabilities to do what I have explained before. Or if it is better to use one or another.
I decided to create a new post since the one that I found looking for something similar is from 2014.
Also, the text editor for now only needs to work on desktop, but in a future might be on other devices and embedded systems.

Qt Designer vs Handcoding

Every time I start a project with some graphical toolkit, one of the first conflicts happen with the decision of how to deal with the visual design and the widget layout: A graphical tool or handcoding?
This is a quite tricky/subjective question because most people will decide based on personal preference. It also depends greatly on the quality of the graphical tool. In this case I would like to focus just on the latest version of the QT library. I do not intend to discuss which method is better. I am convinced that the best answer is: depends on the project.
What I want is a reference to a good non biased article, based on experience after several projects. The article should just describe the tradeoffs of both choices
I started with doing everything hand-coded, and of late have been switching to using Qt Designer for most forms. Here are some benefits for each position:
Using Qt Designer
The biggest time saver for me is managing complex layouts; it saves a lot of tedious coding. Simply (very roughly) arrange your widgets, select them, right-click, and put them in the correct type of layout. Especially as layouts become nested, this is so much easier.
It tends to keep your implementation files cleaner instead of filling them with all the boilerplate layout code. I'm type-A, so I like that.
If you are translating your application, it is possible to send your translators the .ui files so they can see on your GUI where the text they are translating will be. (Assuming they are using Qt Linguist.)
Hand-coding
Control. If you have a layout where you need to instantiate / initialize the controls in a very particular order, or dynamically create the controls based on other criteria (database lookup, etc.), this is the easiest way.
If you have custom widgets, you can kind-of-sort-of use the Designer, adding the closest built-in QWidget from which your class derived and then "upgrading" it. But you won't see a preview of your widget unless you make it a designer plugin in a separate project, which is way too much work for most use cases.
If you have custom widgets that take parameters in their constructor beyond the optional QWidget parent, Designer can't handle it. You have no choice but to add that control manually.
Miscellaneous
I don't use the auto-connect SLOTS and SIGNALS feature (based on naming convention such as "on_my_button_clicked".) I have found that I almost invariably have to set up this connection at a determinate time, not whenever Qt does it for me.
For QWizard forms, I have found that I need to use a different UI file for each page. You can do it all in one, but it becomes very awkward to communicate between pages in any kind of custom way.
In summary, I start with Qt Designer and let it take me as far as it can, then hand-code it from there. That's one nice thing about what Qt Designer generates--it is just another class that becomes a member of your class, and you can access it and manipulate it as you need.
My answer is based on two years developing biochemistry applications using PyQt4 (Python bindings to Qt 4) and OpenGL. I have not done C++ Qt, because we only used C++ for performance-critical algorithms. That said, the PyQt4 API greatly resembles Qt4, so much here still applies.
Qt Designer
Good
Exploration. Discover what widgets are available, the names for those widgets, what properties you can set for each, etc.
Enforces separation of UI logic from application logic.
Bad
If you need to add or remove widgets at run-time, you have to have that logic in code. I think it's a bad idea to put your UI logic in two places.
Making changes to nested layouts. When a layout has no widgets in it, it collapses, and it can be really hard to drag and drop a widget in to the location you want.
Hand coding
Good
Fast if you are very familiar with Qt.
Best choice if you need to add or remove widgets at run-time.
Easier than Qt Designer if you have your own custom widgets.
With discipline, you can still separate UI layout from behavior. Just put your code to create and layout widgets in one place, and your code to set signals and slots in another place.
Bad
Slow if you are new to Qt.
Does not enforce separation of layout from behavior.
Tips
Don't just jump into creating your windows. Start by quickly sketching several possible designs, either on paper or using a tool like Balsamiq Mockups. Though you could do this in Qt Designer, I think it is too tempting to spend a lot of time trying to get your windows to look just right before you've even decided if it is the best design.
If you use Qt Designer for PyQt, you have the extra step of running pyuic4 to compile your *.ui files to Python source files. I found it easy to forget this step and scratch my head for a second why my changes didn't work.
If you code your UI by hand, I suggest putting your layout code in one place and your signals and slots in another place. Doing this makes it easier to change the way your widgets are arranged on a window without affecting any of your application logic. Or you can change some behavior without having to wade through all the layout code.
Enjoy Qt! Now that I am using Java Swing for work, I miss it.
I tend to layout dialogs using the designer but I do all the event handling stuff in the main code. I also do all the main windows, toolbars, menus in direct code.
The designer is just frustrating - a pity since decent drag and drop sizer based designers have been around for more than a decade
It depends on the number of different windows/panels you need for your application. If the number is small, use a graphical tool. It is much faster to get a few windows designed perfectly. If the number is large, the graphical tool can (and should) only be used for prototypes. You need to code the layout to be able to make application-wide changes at acceptable cost.
That includes creating a model of how the UI of the application works and dynamically adding and removing widgets at runtime. For an excellent example of such a model (in a different environment), take a look at the glamour model for creating object browsers.
I object to the suggestion that it is tricky/subjective (at least more than other development choices). It is easy to come up with criteria to decide on. Personal experience and preference are important for that, as they decide when the number of different windows should be considered small. The same goes for tool quality.
My personal opinion (just personal), all GUI based development distracts me too much, my imagination or my mind works very bad when i'm seeing gui objects, i prefer to hand-coding most the time because my imagination works better, you know, is like you were reading a book with no images... when i see nothing else than code its looks like i finish faster...
Second reason, i like c++ so much, so I see the good side of hand-coding, is that I keep my c++ practice no matter if I'm writing something redundant... Coding skill is improved when you only use text... Indeed, i could use nano or vim, but that is too far slow for debuging.
Hand-coding here ++vote
I use a combination of both:
I find for x,y coordinates, Designer is the way to go.
A lot of the other UI properties etc can be set in your code.
I think trying to do UI completely by hand-coding would be a very time consuming project. It's not as simple as setting up HTML tables.
Yes version 4 is bad, but people at work who have used version 3 said it was REALLY bad. Lots of crashing.
I, along with my fellow QTers, are truly hoping that version 5 will be an improvement.
I know this is an old question, but I hope this helps! One man's experience.

flashdevelop vs flex builder

I just started making games and I decided for my next project to use either flashdevelop or flex builder. Reason being is because you can embed just about everything and for licensing purposes and it recommended the the game is compiled into one file. flex sdk is good with that type of stuff.
As of right now I decided to use flashdevelop. but recently it's been kicking my behind. First I wasnt able to use ui class (e.i. buttons, and textboxes) probably because of something stupid I did. Now for some reason I can not compile my applications. When I compile, nothing happens, no errors, no nothing. below is a screenshot of what happens when I compile.
Yes i installed debugger and yes I installed sdk
So now I was thinking about just going with flex builder. Not sure which one is more easier to assemble and use. But I do know the flex builder community is bigger, and they have a much better documentation. I am good with actionscript, but I am not so good with using flex.
My ultimate question is...
Which one is easier to assemble
which one is easier to use
which one is BETTER overall
as far as not compiling goes, looks like it compiled just fine.
I don't know what you're expecting to see from the code other than the "Hello"
to see that open up your output window (under View)
Whether you use flex or flashdevelop, you end up using the same compiler.
Like Adam, I find flashdevelop easier to use than flex, but that's because I've used it more (flex trial expired and FD didn't)
And plus I'm fast with FD, like really fast :)
Try some of the shortcuts:
to create getter and setter or
generate function press 'ctrl shift ~' and PRESTO
or for a for loop or for each loop type in the first few
letters and press 'ctrl B'
to find instances of any string in code you
can do F3 and shift F3, whereas F4
will find the object or function
declaration(even in separate files)
FD also adds a lot of the classes as
needed (sometimes I have to do it manually)
and the latest version lets
you generate classes which extend
another class easier.
I'm sure that flax does most of this as-well, but when you're already used to this then switching slows you down.
I had the same issues when I started working with FD. What it boils down to is that flex has a bunch of libraries that it's using that FD doesn't unless you link to them, and sometimes even then.
But once you start compiling your libraries and assets into SWCs you will be able to compile them through Flash and Flex. Which can be handy (like when you're working with other developers)
FD doesn't have a profiler, but this has not prompted me to stop using it. When I need some debugging and trace isn't enough I add the demonsters debugger class: http://www.monsterdebugger.com/ it's pretty powerful, but you still can't step through your code.
** Update - Flash Develop has had a profiler for a few versions now, It's good for watching memory use, but I still end up using monster debugger a lot. You can use debug in Flash Develop as-well and step through your code.**
FD doesn't have the UI that flex does, and for developing mxml it is a bit more tedious, but at pure as3, I find FD is all I need. Well than and Flash to create my SWCs
I think a lot of it is personal preference, and what you have previously used. Some people do have strong opinions though.
Personally I like FlashDevelop, but only because I am use to it, and can get things done a lot faster e.g. setting up projects, workflow, shortcuts etc. But I am sure If I forced myself to only use FlashBuilder (formally FlexBuilder) that I would soon come to grips with its nuances.
Here are a few of my points for either side:
FlashDevelop:
I like how FlashDevelop is so simple,
where as Flash Builder is rather
bulky.
FlashDevelop is totally free, where Flash Builder actually cost quite a bit.
Flash Builder:
Built on Eclipse, so has a massive community, tons of plug-ins etc.
Source control intergrated into the IDE (very important in large projects).
Also might want to check out this article on ActionScript Editors.
I know it's an old topic, but in case someone finds it, here is an interesting thing I've noticed:
I am using pixel fonts in my project, and by default Flash Player blurs part of it (it is a known problem). One solution is to use a bitmap text (some kind of custom class) and the other is to use Text Renderer with some of its related elements to force Flash to render the font correctly. When compiling under the same version of Flex SDK in Flash Builder 4+ the font rendered correctly. But when I compiled with Flash Develop (latest version) the text was really ugly, with missing pixels at random places. It might be caused by the fact that Flash Develop or Flash Builder are sending some hidden arguments to the compiler which either make it work/break.
This is a long running question that has been repeated a few times. Review this question and see if it answers yours.
Web-based Game Development: Flex Builder or Flash CS3?

.NET : How to Create thumbnail from flash

Is there any way where i can create a thumbnail image from a flash movie file(flv /swf) [NOT FROM A VIDEO File ] in ASP.NET ? Any samples of implementation ?
you can use ffmpeg to create thumbnails of the flash video
For .flv you can use ffmpeg to convert parts of the video (e.g. one frame) into an image (sequence)
I've used it as command-line application by calling Process.Start(), but there is at least one wrapper for .NET (I haven't tested it myself):
http://www.codeplex.com/ffmpegdotnet
For .swf I don't know any way to achieve this without some Adobe tool.
for flv it can be done easily, as others mentioned ...
for swf, it depends HIGHLY on the swf ... if the swfs visual appearence is determined by code, there is no other way than to embed a flash player in you app and either let the flash player make the snapshots, encode them as JPEG/PNG, and send them somewhere using TCP or LocalConnection (a flash<->flash communication connection, which can be used with C# as well) or try to somehow grab its output buffer yourself ... the first possibility should be no more than 10-20 lines of actionscript code ... don't know about the latter ...
other than that, you might use an external command line converter ... there are a few floating around the web ...
greetz
back2dos
Take a look at this article, it should point you in the right direction. It uses SharpFFmpeg to extract thumbnail images from movie clips from a variety of formats.
the only way to get an image, is to use a full flash client that starts playing and allows you to capture the first frame.
I would take a close look at flirt (they actually have an example that renders pngs)
Maybe some of the other flash libraries may be of help ( swfdec gnash swift tools gplflash)
Gnash is probably the best choice since its the most mature project out there, but i do not know how easy it is to integrate into command line tools or into your own projects.
We have been working on this in my company, and we got a proof of concept working pretty fast (but the project we made it for is on hold right now). I am not able to share the code, but I can give you some pointers.
It is not pure ASP.NET, but maybe you can still use it. We made a windows service that can be called from ASP.NET.
Basicly you install the flash plugin on the server, the windows services can then simply open the swf through the swf ActiveX component and then you can grap a picture of the whole thing. It works pretty well, notice that you do not have to actually render the ActiveX component on screen to capture the picture.
Check out this post. It does not tell you everything but I guess it provides the ground work required for it. You probably have to figure out how to get the object tag out of the flash-html you are trying to download from a web page. After that you'd have to figure out when to capture the frames. Its a long ride however. You don't need the asp.net part. Just concentrate on the windows project part. Hope this helps. :)

Any way to analyze the size of a SWF built in Flex?

I have a Flex application that seems larger than it should be. There is a lot of code in it, but not a lot of assets and it just seems large, but I'm not sure how to go about figuring out where the space is going.
I know about the –link-report option, but it only gives the sizes of externally linked library classes. I'm very interested in seeing a report of the sizes of all the classes and resources in my application and it would be a huge bonus if I could also view their dependencies. Not knowing how the code is compiled I'm not sure if this is even possible, but it seems like it should since the compiler can give me the sizes of individual classes linked from other libraries.
I did some searching around, but couldn't find anything helpful. Everything points to the optimization techniques of modularizing and externally linking libraries, which I understand and will implement, but I would really love some more detailed reports of what my compiled application looks like.
To be clear, I'm not really interested in tips on how to reduce the file size, just a report on what is used for and which classes are referencing what.
Anybody have any ideas?
CORRECTION - The link report does show all classes. My particular project in Flex Builder had several CSS files set to compile to swfs. My link report for the main app was being overwritten by these css compiles!
The link report actually contains all compiled classes and not just the ones in external libraries (at least with the Flex 4 SDK). There is an xsl available that will generate an html file of the link report so it is easier to read.
Check this post: http://blog.iconara.net/2007/02/25/visualizing-mxmlcs-link-report/
There is a command-line utility called flash.swf.tools.SwfxPrinter in swfkit.jar, which comes with Flex Builder (or the plug-in or the SDK) and which you can use to analyze information about class sizes. Joe Berkovitz wrote some good instructions on how to make use of it in his blog, and he was working on an AIR-based GUI tool that leverages it, but I'm not sure if he ever published the tool. Still, you can use his instructions to leverage the utility directly from the JAR.
I found a handy little AIR app that really helps organize the link report info.
http://www.kahunaburger.com/2008/03/08/air-link-report-visualizer/
It's old but still works very well.

Resources