Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Add option to import JPG images (as BLOB) #1188

Closed
SilvioGrosso opened this issue Oct 22, 2017 · 20 comments
Closed

Feature request: Add option to import JPG images (as BLOB) #1188

SilvioGrosso opened this issue Oct 22, 2017 · 20 comments

Comments

@SilvioGrosso
Copy link

Hello everyone,

Please, add an option to import into Sqlite databases jpeg images.

Currently, on Windows 10 - Windows 7 (64bit .exe installer) I can import - export png images.
With png everything works fine. For instance, I can drag them into my Database through the GUI.
On the contrary, it looks like jpeg images are not supported at all.
At least on Windows, maybe on Linux it is different...

I am testing the 3.10.99 version (on Windows 7 - 10)
QT 5.7.1
Sqltie 3.20.0

I have also:
Tried out the latest nightly version: https://github.com/sqlitebrowser/sqlitebrowser#nightly-builds

Thanks a lot !

@justinclift
Copy link
Member

Ahhh. I think the type of files supported depends on us including Qt plugins.

From faint memory, it might be as simple as us creating a "plugins" subdirectory in the location we install to, and copying the correct plugin pieces into it.

Haven't looked into it yet, but it might not be too hard. 😄

@MKleusberg
Copy link
Member

Seems to be related to #579. Did we miss that for the 3.10.0 release? 😄

@SilvioGrosso
Copy link
Author

SilvioGrosso commented Oct 29, 2017 via email

@chrisjlocke chrisjlocke changed the title Feature request: Add option to impot jpg image (as blob) Feature request: Add option to import JPG images (as BLOB) Oct 29, 2017
@justinclift
Copy link
Member

Yeah, we missed that. Figuring out this plugin thing has been on my wish list for a while... I've just not really gotten around to figuring out how to get it done. 😄

We can probably start with (say) Windows first, and once that's been figured out it shouldn't be too hard to copy the approach to also work on OSX. Linux/BSD though, I'm not sure about. We might have to investigate how other Qt applications do things there. That's a problem for a later date. 😄

@SilvioGrosso
Copy link
Author

SilvioGrosso commented Oct 29, 2017 via email

@justinclift
Copy link
Member

😄

I'll close this as a duplicate of #579, as we're trying to keep the open issue count from exploding tooooooo much. 😄

@MKleusberg
Copy link
Member

@SilvioGrosso If you're interested in putting some effort into this, you can try downloading the right Qt version from here, installing it, and trying to locate the JPEG plugin DLL. There's probably somewhere in the installation directory a directory called plugins with an imageformats directory in it. From there you should be able to just copy all files (or all you need) into a newly created sub-directory called "plugins" in your SQLiteBrowser/DB4S directory, if that makes sense 😉 I can't go into any details here because I don't have a Windows system available right now. But in theory it should just work with the right DLL in the right place.

@justinclift
Copy link
Member

If someone has time to do that, and report success/failure, that would be really helpful.

The Qt version we use for the Windows builds is Qt 5.7.1. That can definitely still be downloaded from the Qt website. 😄

@SilvioGrosso
Copy link
Author

SilvioGrosso commented Oct 30, 2017 via email

@SilvioGrosso
Copy link
Author

Sorry about my previous post :-(
My Yahoo provider as screwed up all my email message formattings (as usual...) on top of deleting my Dropbox link (with all my steps recorded on Windows 7 - 64 bit).
Here is the link:
https://www.dropbox.com/s/rr996pdthgvrpij/SQLITEBROWSER_QT_JPEG_PLUGINS.mp4?dl=0

@MKleusberg
Copy link
Member

Hmm, two more ideas then:

  1. Can you see what happens if you rename the "plugins" directory to "imageformats"?
  2. If that doesn't work, can you check if it's working if you move all the files from the "plugins"/"imageformats" directory directly into the directory where the "DB Browser for SQLite.exe" file is?

@SilvioGrosso
Copy link
Author

SilvioGrosso commented Oct 30, 2017 via email

@justinclift
Copy link
Member

justinclift commented Oct 30, 2017

Ahhh, I think it's probably a mismatch on the MSVC version. We're still using MSVC 2013, and looking at the Qt 5.7.1 archives it has separate downloads for MSVC 2015 vs MSVC 2013. The "winrt" bit in the filename you grab make me think it might be wrong too. We're definitely not using the WinRT bits, as we're building for Win7 and above.

I probably should have thought to check this stuff before. Sorry.

This seems like it would be the right one:

You'd probably want to uninstall the one you installed earlier too, just to make sure there's no chance of it's library files somehow getting picked up by the system.

Hopefully that works. 😄

@SilvioGrosso
Copy link
Author

Hello Justin !

Just installed the Qt 5.7.1 downloaded thanks to your last link.
I have installed this different QT version on a new clean Windows computer whose version is 8.1 (previous one had 7 version).
On this hardware I have installed today's version (3.10.99) of SqliteBrowser (x64.exe installer).

To make it short it does not work.

In essence:

  1. paste the whole folder named as "imageformats" does not allow to open jpeg image (neither by dragging nor importing them) ;
  2. renaming this folder as "plugins" does not work ;
  3. pasting all files into the main folder of SqliteBrowser does not work either.

My best regards

MKleusberg added a commit that referenced this issue Oct 31, 2017
Not sure if this is necessary because the documentation says that it is
automatically added but it's worth a try.

See issue #1188.
@MKleusberg
Copy link
Member

One more try 😉 Can you install tomorrow's nightly build and check again if it works with the plugins directory?

@SilvioGrosso
Copy link
Author

You nailed ! :-)

Just tested on 3 different systems: Windows 7 + 8.1 + 10 (x64 bit) with today's daily build.
I can now import all jpeg images on top of other formas (tiff, gif etc not tested yet).
On top of that, I can also export jpeg images.
To do so I have pasted the imageformats folder into the directory where I have installed Db Browser for Sqlite.
It works smoothly when it is named as "imageformats" (not "plugins" as also suggested).

Here is the link to download from Dropbox these QT 5.7.1 dlls librairies:
https://www.dropbox.com/s/3qvtcgbrqbi2oty/imageformats.zip?dl=0

I have even uploaded on YouTube a short video tutorial (I hope you don't mind):
https://www.youtube.com/watch?v=CW739mop1Nc

Thanks a bunch indeed !

@justinclift
Copy link
Member

I have even uploaded on YouTube a short video tutorial (I hope you don't mind)

That's awesome. Added it to the front page of our wiki, in a new "Videos for Users" section.

Want to create more? 😀

@MKleusberg
Copy link
Member

Awesome 😄 I'm glad this is finally working now!

@justinclift Do you have any experience with this part of the CMakeLists.txt file to somehow include the files in the installer? We would need to copy the .dll files (.dll for release model, *d.dll for debug mode) from that Qt plugins/imageformats directory to the imageformats directory in our installation dir. Also we would need to include different DLLs depending on whether we're building the 32bit or the 64bit version. I'm guessing that this would just work with our current build process but I'm not sure 😉

@SilvioGrosso Thanks for your time and effort on this 👍 Since you seem to know all the other SQLite GUIs and I have never really bothered looking into them, if you feel like we're missing some important feature or two, feel free to open an issue for that, too 😉

@justinclift justinclift reopened this Nov 1, 2017
@justinclift
Copy link
Member

@MKleusberg Yep. Just finished setting up a new Win7 development VM to try things out in, as I don't want to screw up our build one (just in case). I should be able to get this figured out... 😄

@justinclift
Copy link
Member

Hmmm, it's probably better to continue the conversation in the other issue. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants