How to layout a given number of thumbnails N of picW x picH into m columns and n rows in a given page (pageW x pageH) so that the “to be applied” scale is maximal? All thumbnails yield the same dimensions, reordering is not allowed, rotation neither. If the chosen scale is maximized, then the result will have the biggest possible thumbnails. I need this for the contactSheet-script, because currently it uses fixed column-sizes and I don’t want to figure this out manually each time the wanted page- or thumbnail-size or the amount of thumbnails changes.
I am aware, that this is some kind of well known bin-packing problem, but just after implementing the very first naive approach I figured out that there is maybe(?) no closed equation possible: just iterating over all possible cases. Maybe I missed something, but the current approach would look like the following. I will move this from C++/Qt to sh soon, because this will become part of contactSheet-script which I apply to every set of scanned film 😉
int const pageW(ui->pageW_LE->text().toInt()); //maybe validate later!
int const pageH(ui->pageH_LE->text().toInt()); //maybe validate later!
int const picW(ui->picW_LE->text().toInt()); //maybe validate later!
int const picH(ui->picH_LE->text().toInt()); //maybe validate later!
int const N(ui->N_LE->text().toInt()); //maybe validate later!
for(int m(1); m <= N; m++)
int const n = N / m + ((N % m != 0) ? 1 : 0);
qDebug() << "############################################\nm * n: " << QString::number(m) << " * " << QString::number(n);
double const scaleW = (double)pageW / (double)(m * picW);
double const scaleH = (double)pageH / (double)(n * picH);
qDebug() << "scales: " << QString::number(scaleW) << " * " << QString::number(scaleH);
double const minScale(scaleW < scaleH ? scaleW : scaleH);
double const resultW = m * minScale * picW;
double const resultH = n * minScale * picH;
double const A = resultW * resultH;
qDebug() << "A = " << QString::number(A) << " with scale " << QString::number(minScale);
//use the first found biggest result
if(minScale > maxScale)
maxScale = minScale; //save for later usage
maxA = A; //just for checking
result = m;
result = n;
qDebug() << "\n\nlayout with:" << QString::number(result) << "*" << QString::number(result) << " with A = " << QString::number(maxA) << " and scale " << QString::number(maxScale);
By the way: the sketch has been done with draw.io, because I stopped using Dia …
Well-equipped and already upgraded.
Due to the fact that I shoot a lot of expired 135 film, developd and digitalize it, I decided it’s time to acquire my own film scanner.
After some brief thinking I aimed for a Nikon LS 4000 or 5000. Facts which mattered were the unreached resolution of 4.000 dpi (for real – not some marketing speech), high dynamic range and the automatic transport of filmstrips (pure convenience).
With some luck I grabbed a fairly cheap LS 4000 in nearly mint condition with MA21- and SA21-holders. Needless to say I spent some more money on new firewire-cables, a pc-express-card and other crap. After upgrading the firmware from 1.05 to 1.10 SilverFast 8 also recognized the holder correctly. Nikon Scan and vueScan did right out of the box.
But at least the best improvement was quite cheap: why stay with a “just 6 frames per filmstrip allowed”-holder if you can have a SA30?
I bought the combination with the following upgrade in mind. For now the revertable version is applied and working 🙂
Step 0: connect pin 4 and 5 with a thin wire; Step 1: put cover it with some tape and poke holes inside for the male connectors; Step 2: gently push it inside
Scrub images before you share them!
I was surprised I never mentioned this, but I often remove all metadata from image-files before publishing them. I am no criminal, but where and when some pictures have been taken is none of the business of strangers 😉
exiftool -all= foo.jpg
Link for more details.
At least once I had the appropriate tools at hand ..
tl;dr: How to retrieve ext4-data from the broken laptop’s drive with a Mac mini (OSX 10.9)
* download and install FUSE for OSX
* download and install fuse-ext2
* mount the specific partitions via diskutil & copy the wanted data & wait ..