Home

Cardbox Talk

 

CardboxForumsCardbox Talk > "Downloading images"

Downloading images

How to download images in high resolution

Current user: [none]
Register / Log In · Help

Posted By Post

Peter15

1-Oct-2017 18:46

When I upload photographic images Cardbox compresses jpeg for storage. That's fine until I want to extract these images and need to have them in their original high resolution. So far I have not found a way of extracting them other than in their compressed form. The original images are not in Amazon S3 though they are one OneDrive.

Can somebody help please?

Peter

John Francis

1-Oct-2017 19:43

I never put an actual image into Cardbox, partly for this reason; I simply include in the cardbox record a link to the original image in a separate folder.

The syntax for the link is something like: file:C:\photos\birds\chaffinch0241.tif

Hope this helps.

John Francis

bert

1-Oct-2017 19:53

Well, that is the blessing of JPG compression!
The time Cardbox was build, we did not have so much room for data. So it was more then necessary to compress. Cardbox compresses on high quality in my opinion a little too much. However: you can change the compression values by adding two lines in cardbox3.ini in your windows folder.
If you add:
[Image Compression]
JPEG Low Quality=90
JPEG High Quality=90
both compressions you choose now are JPG 90% in stead of the standard 80 and 60 or so. To reach maximum value, change it to 100. It still will decrease quality, because reading jpg 100 is still a jpg compression. My experience brings me to 90. This is a good comprise to quality/size.
Alternative: Add a second image field. First you use for storing a thumbnail, second for storing the original jpg file. Store the jpg as a non-imagefile. I did this for a 10000 image database. Worked fine. The only reason I stopped this system because the backup for the database (60 GB) took too much time.
I now build image banks by storing a thumbnail (longest side 800 pixels) in Cardbox and add a link to the original file into another field. The read process I do by a macro. Can also add a lot of EXIF then. For launching the original file I use Irfanview. Btw, I also use Irfanview for adding images. This because Irfanview resize/compress with much more quality then the Cardbox JPG compression does. But, as always, this is real scripting.
Regards
Bert

Chris H

2-Oct-2017 08:13

An aside from the previous communications re. image quality, I wanted to check my cardbox3.ini file for its compression settings but cannot find it on my computer. Where should it be? Can I create one using say Notepad? what else might be in such a file? Does Cardbox automatically 'look' in this file when opening??
Chris H

bert

2-Oct-2017 09:29

In my mail I wrote "cardbox3.ini in your windows folder.". So, there it is.
If it is not, create one with notepad. Cardbox will see it.
If you look in knowledge then you'll find cardbox3.ini again, but then used for a path to Ghostscript for making screen-dumps while importing pdf's. One search in Google to cardox3.ini tells us: http://www.cardbox.com/support/kb/importPDF.htm.
Regards
Bert

Charles Welling

5-Oct-2017 20:10

There's a much easier solution to circumvent the JPG compression of Cardbox and it's built-in.
What few people seem to know is that Cardbox DOES NOT re-compress a JPG file that is read from disk. It compresses:
- any non-compressed file format
- any file that is pasted into the image field using the clipboard

When a JPG is copied to the clipboard and then pasted into Cardbox, it will be re-compressed because Cardbox does not know it was originally a JPG. It's just a collection of pixels.
Any JPG that is read from disk however will be copied "as is".

For those of you who doubt it, try this:
First make sure that the option "store compressed" which activates a stronger compression is not selected.

1. Read a high-quality JPG from disk and look at the image size in bytes that Carbox reports. It will be the same as the original file. Do not save the record but:
2. Copy the original file to the clipboard and then paste it into Cardbox. The image size will be smaller and quality will deteriorate.
3. Then, looking at the second already compressed image, select "store compressed". The second image will become even smaller and quality will deteriorate further.
4. Switch to the first image (read from file) and try "store compressed on this image. It will not change.

There even no need to use an image programme to copy the original JPG to the clipboard. You may even copy the image that you've just read into Cardbox and then paste it. That one will be compressed because, again, Cardbox will no longer know that it was a JPG.

So, anyone who wishes to keep the original quality of a JPG (the size of the image is irrelevant) must read it from file, that's all.

bert

5-Oct-2017 20:34

You are right. **Only** in case of jpg (no Tif!) + reading the file + not any resizing + no resolution change in Cardbox while saving the record. And I' me sorry, this situation I did not met very frequent.

My advice is always: leave the original file untouched on disk, store a 800-1000 pixels high/wide image in you db with a link to your original. A database with 5000 unchanged images of camera's today, will soon be slow an irritant.
And keep this all ok and pretty fast, there are perfect ways to get this.
Regards
Bert

Charles Welling

6-Oct-2017 06:53

Of course someone should consider the disadvantages of storing large images in a database. But my remarks relate to images of all sizes. In other words, if someone wants to store small images in Cardbox but also wants to keep the original quality, then the simplest solution would be to read them from file, which is by all means the simplest way anyway.
You should be aware that changing the ini-file and setting the compression to 90 may actually increase storage size without improving the quality. Reading them from the original file keeps the original compression and quality, whatever they were.

And as to your observation:
"reading the file + not any resizing + no resolution change in Cardbox while saving the record. And I' me sorry, this situation I did not met very frequent."

Nobody should use Cardbox to resize or change an image because the resulting quality is poor. Cardbox is NOT a specialised image-processing programme. It's far better, and I believe it's common practice, to process the images before they are read. We use Irfanview to process the images (resize, watermarks etc) and then read them into the database using macros. Works perfectly and I'm talking about 600,000 ++ images.

Peter15

2-Dec-2017 12:14

Hi Bert, Thanks for yours of 1 Oct and sorry for not replying more quickly. Looks like a great solution. However I can't find cardbox3.ini and am somewhat uncertain what, in a Cardbox context, a 'windows folder' is. You do have at least one non-geek in this forum!
I also have a macro - I must have got from 'support' many years ago - which extracts in a .bmp format. It produces such vastly different results - varying from 40mb per picture to 2 or 3 - that I doubt its usefulness. In any event bmp seems to be replaced for many uses by jpg.
Thanks,
Peter

bert

2-Dec-2017 13:58

Cardbox3.ini is in c:\windows. If want to change this, you need in most Windows versions admin-rights. The simplest way to change cardbox3.ini is to type from your Run command line in Windows c:\windows\cardbox3.ini and then SHIFT + Ok button. You can edit/save than the file being administrator.
The BMP result of your images by your macro: If the images when read were not same size, you get using a simple export also that different sizes. If you want a fixed size in JPG, this you can reach this by changing you macro.
So, please, copy and paste the macro in post (in Cardbox F5, manage, edit, ctrl-A, ctrl-C an paste it in a post). I think it is a small change.
Regards
Bert

Peter15

2-Dec-2017 16:02

Thanks Bert but I cannot find 'cardox3.ini' in Windows or anywhere else. I read your advice above to create it in Notebook but that's another learning curve!
Best wishes,
Peter

bert

2-Dec-2017 17:03

Ok, if it is not there... Add it!
Possible content:

[Image Compression]
JPEG Low Quality=90
JPEG High Quality=90

Run Notepad as Administrator. Otherwise you cannot save this file in this folder.
Regards
Bert

Peter15

3-Dec-2017 12:30

Thanks. I understand and have done this.
I take you point however about slowing down my database with its 22,000+ low resolution images. I have the link on the database to the original photos. Is there a sample macro to enable me to copy selected photos in their original size to another folder?
The link is in this format D:\OneDrive Docs\OneDrive\Pictures\Pictures\2017\Edited - Oct\img_5021.jpg
The transfer macro I use at the moment transfers from the database directly as follows:
Sub WriteAllImages(rec,filenamebase)
Set imgs=rec.Images
for i=1 to imgs.Count
imgs(i).WriteToFile filenamebase & i & ".jpg",cbxImageOverwriteFile +cbxImageNonBMP
next
End Sub

Const BASENAME="D:\OneDrive Docs\OneDrive\Pictures\Pictures\Transfer\No"
Set recs=Records
n=recs.Count
StatusRange=n
for j=1 to n
WriteAllImages recs(j), BASENAME & j & "-"
StatusPosition=j
next

Any advice within my very limited competence would be much appreciated.

Best wishes,

Peter

bert

3-Dec-2017 16:35

The macro writes from the selected records all images in their size as they are in Cardbox to folder D:\OneDrive Docs\OneDrive\Pictures\Pictures\Transfer.
The filename is NO[record number of selection]-[imgnummber of that record].jpg.
So, your macro does not export files in BMP, but to JPG.

I understand now that that you need a (different) macro that reads in field [field name] the location & name of a file on your disk, and you want to move that file to another folder. Doing this the link in Cardbox fields [field name] also has to be updated. Right?

That is in a macro no problem. However, that has to be developed. If you also like to choose the destination folder by a Windows folder dialog then is this also possible.
Regards
Bert

Peter15

3-Dec-2017 23:48

Your understanding is correct.
I have abandoned putting higher compression jpgs on my large database because of the adverse impact on speed and I have also abandoned a bmp route as I seldom use bmp.
My ideal would now therefore be a macro which would link any selection I made of the compressed images on the database to the original jpg images in separate folders on the computer (using the link information given in a separate field on the same database) and then transfer them to another folder in their original uncompressed form. The end result would therefore be that of the macro above but with the very significant addition, so far as I am concerned, of the images being transferred in their uncompressed form.
I understand you to say that that is possible but would require 'development'. Is that 'development' something a reasonable competent friend with software skills might be able to achieve without too much trouble?
Thanks so much,

Peter

bert

4-Dec-2017 10:53

I think you mean this:
1. you want to make a selection
2. in selected records is a full name of the uncompressed image present in let's say field FILENAME
3. a macro can copy in a batch all the uncompressed images of that selection to a certain folder (always same)
4. the file name of the copied file is identical to the source name.
5. in your database happens nothing.
Right?

Peter15

4-Dec-2017 21:36

Thanks so much Bert.

Here is my response to your points above:
1 Selection yes using the compressed pictures and other triggers on the database (date, name, place etc) to make the selection
2 Yes.
3 Great. Exactly what I was hoping for
4 If this means that the name in a field on the database (eg 'FILENAME') is identical to the name of the uncompressed image in a separate folder on the computer then yes. In fact I have 3 fields which relate to the separate image folders as follows: one gives the location pathway (eg Docs\OneDrive\Pictures\Pictures\2017\Edited - Nov\ ); another gives the filename (eg img_5181.jpg) and a third combines them (eg D:\OneDrive Docs\OneDrive\Pictures\Pictures\2017\Edited - Nov\img_5181.jpg )
5 Correct

The end result would be, as I understand it, that as well as being able to copy compressed images as the macro I sent yesterday does very successfully I would be able to copy images in their original uncompressed form - a very useful addition.

Again apologies for my lack of technical mastery.

Peter

Quick Reply

Please log in or register before trying to post a reply.

 
© 2010 Cardbox Software Limited   Home