Jump to content
TNG Community
Checker

Photo size limits

Recommended Posts

Checker

After trying to add a photo - file size 4.12MB - TNG 9 complained about not being able to produce the thumbnail, presumably because the file is too big, so the question is: what is the max size for a photo?

I searched the forum, but the earlier question on this topic I could find never did get an answer and for the two other search results, I got an error message about the mysql server having one away, or something along those lines.

I understand 4 MB is rather big and in this instance I might be able to live with less resolution, but if I need to squeeze the photos, where else will I run into limits?

Media files....?

TIA for any help,

Arnold

Share this post


Link to post
Share on other sites
Martin J Mosley

Hi Arnold,

1mb appears to be the maximum for thumbnails to work. Obviously even at 1mb, the files are relatively heavy, and unless there is a good reason to make them bigger, I upload pictures and documents at no more than 250kb.

Document images are the same, and can be more problematic since the balance is between size and readability.. Again I tend to work on 250kb which seems to work for most documents saved in jpeg format.

PDF documents won't thumbnail, at least in tng.

Hope this helps.

Martin

Share this post


Link to post
Share on other sites
Curt

Arnold,

I've been limiting pictures to 2000x2000 pixels. In addition, I use the program IrfanView to crop (if needed) and reduce image file size with the plugin "Save for Web".

Curt

Share this post


Link to post
Share on other sites
Checker

Thank you both, Martin & Curt

TNG was not designed nor should be used as a hi-def picture repository, I guess &

I shouldn't try to make or use it that way either. :-)

Arnold

Share this post


Link to post
Share on other sites
Checker

Arnold,

I've been limiting pictures to 2000x2000 pixels. In addition, I use the program IrfanView to crop (if needed) and reduce image file size with the plugin "Save for Web".

Curt

Picking up this old thread of mine (my work on this seems to come in fits and starts) , mainly because my next question ties in so closely to the comments I had received.

Over the past little while I have collected more images of original records - all kept at a rather high resolution to preserve readability as much as possible for later review.

So now the burning question for me is: how do I link these high resolution and rather large files - to the smaller versions which are or will be part of the TNG file structure?

My main concern is to ensure that these files are tightly enough coupled to not get lost when backups are made.

Given enough disk space on my server, I suppose there'd be nothing to prevent me from saving the files on-line, but I am a bit reluctant to go that route.

Anyone have any thoughts or ready-made solutions I can apply directly?

TIA

Arnold

Share this post


Link to post
Share on other sites
Craig Arno

I ran into this issue this morning.  I ended up re-scaling a 3024x4032 original JPEG scanned image from my sister to 50% 1512x2016 before the image would create a thumbnail and be accepted into the TNG v11.1.1 Photo Media Library.

After creating the Thumbnail image I tried restoring the original 3024x4032 image to the TNG Photo area using the same filename.  It worked!  The Thumbnail created from the downscaled image remained and is used by the 3024x4032 image now stored on disk.  Of course tagging the image (with genealogy entries) has to be done with the full scale 3024x4032 image, but I am able to keep the original large image.  The only real issue is all the manual effort required to get the thumbnail image created from the larger image.

This image size limit issue is exacerbated by today's "standard" equipment.  Scanners default to a 1:1 image size of 3024x4032.  Anything less requires tedious manual intervention.  My "inexpensive" 43-inch 4K monitor can fully view a 1512x2016 image in a window at 1:1 scaling, and this will get worse with 8K and 16K monitors as they become "commodity" equipment.  My 24TB disk array has no problem holding a large quantity of larger images.  With time and Moore's Law the Storage issue argument doesn't exist.  Just like I prefer watching my 4K video collection over watching movies from my 480i VHS tape/DVD collection, TNG needs to be able to support the latest "high resolution" media for historical record collection efforts.

I hope Darrin can find the time to remove the image size limit from Thumbnail Image Generation in the Media Library.  This is just a "bug".  I'll have to investigate how to report TNG bugs and report this one.

I love TNG for all the ways it helps enhance and support a family's genealogy story.

Share this post


Link to post
Share on other sites
Ken Roy
1 hour ago, Craig Arno said:

I hope Darrin can find the time to remove the image size limit from Thumbnail Image Generation in the Media Library.  This is just a "bug".  I'll have to investigate how to report TNG bugs and report this one.

Craig,

This should NOT be considered a bug.  The issue is that if your have very large files like you seem to be using, PHP runs out of memory and cannot generate the thumbnail.

Unless you are running your own server, you will also run out of space on any hosting site that you use.  You are not going to be able to get a 24TB space on a hosting service.

Share this post


Link to post
Share on other sites
jayat1familytree

Craig,  

I agree with Ken, it's not a bug in the TNG code. 

However, one way that Darrin could improve the situation for persons like you (using large image files) would be to allow the use of absolute paths (hardcoded) for some images and to store that data in a separate database table so that it doesn't get overwritten when importing a new gedcom. 

During import TNG could first check to see if the image exists on the "static_media_table" and if so use that existing media item and if not then create the new media item number  which then later would require a thumbnail to be generated. 

I am sure there might be other ways to work around that issue.

You should make your feelings known to Darrin. 

 

I myself have over 60,000 media files linked over 76,000 times and have over 20GB of space. I couldn't image having 24TB !!  I don't think many programs could even handle processing that!

Just my thoughts.

Jay 

 

 

 

 

 

Share this post


Link to post
Share on other sites
Craig Arno
17 minutes ago, jayat1familytree said:

I couldn't image having 24TB !!  I don't think many programs could even handle processing that!

That is 24TB of usable space, 1/2 empty.  My TNG collection only uses about 8GB of that 24TB.

Share this post


Link to post
Share on other sites
Craig Arno

This site keeps blocking me, so I'll try dividing my message into 3 parts:

1/3:

Ken,

Thank you for this helpful/useful tip.  Now I know where to look.  Darrin responded the other night explaining this is a known issue.

I found the limit /etc/php/7.0/apache2/php.ini on my system set to the default 128MB.  I changed this to 512MB.

  ; Maximum amount of memory a script may consume (128MB)
  ; http://php.net/memory-limit
  memory_limit = 512M

Share this post


Link to post
Share on other sites
Craig Arno

2/3:

It might be useful to have this [can't create Thumbnail] error offer a URL link to solutions to common well known issues (maybe to the TNG Wiki) with information copied from places like Stack Overflow.  It might also be useful to provide pointers to PHP's /etc/php/.../php.ini file for adjusting or removing PHP memory limitations.  Apparently adjusting these limits a little higher, like 2x-4x the default settings may remove the problem.  (I haven't tried this yet, waiting for the next jumbo picture my sister sends, which given our frequency of updates could be when Winter arrives, or tomorrow)

BTW, yes I do run my own server with 16GB RAM + another 16GB swap space and 8-cores, plenty of horsepower for TNG.  The real use of this server is to support my Engineering development work.  TNG is a very useful... "Oh yeah, I can support that for our family too".  TNG with all my giant images and 2000+ people entries uses only 8GB of disk, which is easily backed up to a thumb drive.  So disk space for TNG is currently not a concern.  TNG is such a fantastic tool that it gets a lot of my attention (it's better than Solitaire, and yes, you can quote me)

Others running TNG on Synology servers with tighter limits may also need this PHP / Apache memory adjusting information.  A nice error message URL pointing to the Wiki Information adjusting memory limits might help make this issue a thing of the past, or at least give people renting space on servers some useful things to pass along to the admins of these servers.

Share this post


Link to post
Share on other sites
Ken Roy

Craig,

You are welcomed to create a TNG Wiki article in the Troubleshooting category on the subject.

BTW, not every TNG user will be able to run their own server much less one with the large data space, much less have the knowledge to set it up and tweak it.  Most hosting services offer 5 GB of space at reasonable cost.  

Share this post


Link to post
Share on other sites
Craig Arno

3/3:  Think we finally have the blocking issue cleared, so I'm trying again... for anyone running their own server, or to pass along to an ISP service.

Basically the quote says check Apache's RLimitMEM in httpd.conf.  If this Apache web server limit is set too low will starve out the PHP process and cause a PHP script to fail due to lack of memory.

Quote

https://stackoverflow.com/questions/13955914/php-out-of-memory-error-even-though-memory-limit-not-reached


I finally found the answer. The clue came from pcguru's answer beginning 'Since the server has only 1 GB of RAM...'.

On a hunch I looked to see whether Apache had memory limits of its own as those were likely to affect PHP's ability to allocate memory. Right at the top of httpd.conf I found this statement: RLimitMEM 204535125

This is put there by whm/cpanel. According to the following webpage whm/cpanel incorrectly calculates its value on a virtual server... http://forums.jaguarpc.com/vps-dedicated/17341-apache-memory-limit-rlimitmem.html

The script that runs out of memory gets most of the way through, so I increased RLimitMEM to 268435456 (256 MB) and reran the script. It completed its array merge and produced the csv file for download.
ETA: After further reading about RLimitMEM and RLimitCPU I decided to remove them from httpd.conf. This allows ini_set('memory_limit','###M') to work, and I now give that particular script the extra memory it needs. I also doubled the RAM on that server. 

 

Share this post


Link to post
Share on other sites
Craig Arno

Ken,

Yeah, I get it, and thank you for trying to help me understand.

I'm also aware of things like Synology servers as "commodity" equipment, don't draw much more power than a phone answering machine, have enough horsepower to run TNG, a PLEX Media server (your own personal Netflix) for all your movies and TV programs, and have a pile of storage space left over to act as a giant RAID-5 network disk drive for your home or SOHO storage needs. https://www.synology.com/en-global/products/DS918+ . Synology has made these things so easy to run, order from Amazon, fire up a web browser and point and click the configuration you want.  Yes, they also support Mac machines.  I realize not everyone is interested in experiencing the learning curve to do this, and that is where ISP's come to the rescue for a price.  Yes, I'm an unusual "corner condition", but I use this equipment heavily for a large number of tasks and built my own server from scratch to support my own development needs.  TNG is yet another neat tool my family enjoys on the system.  Darrin did an amazing job creating this application for genealogy work, not idle praise.

BTW, I didn't know PHP was running out of memory.  This information was enough to tell me where to look.  I hope the information I posted here will help others who find this thread using Google, as I did.

Thanks,
Craig

Share this post


Link to post
Share on other sites
Craig Arno

Reporting back on a large image import.  I added a Census image (JPEG Image, 3156 × 4370 pixels, 841.74 KB) with the PHP memory limit change described above.  A Thumbnail image was successfully generated from this jumbo image.

In this case the larger image is nice to be able to read the logged hand written cursive entries.

thumb_Akers-939-1870census.jpg   Akers-939.jpg

Share this post


Link to post
Share on other sites
tngrlkrz
On 2/6/2013 at 3:14 PM, Checker said:

I understand 4 MB is rather big and in this instance I might be able to live with less resolution, but if I need to squeeze the photos, where else will I run into limits?

Hopefully this is on topic, but, based on other forum threads, I don't believe I am the only user who gets around the thumbnail creation issue by creating the thumbnails offline, on the PC.  I encountered into this TNG thumbnail issue long ago and looked for an alternative.  I use Easy Thumbnails (a free Windows utility, there are other utilities available) for generating all thumbs, then upload them along with the original images to an appropriate media folder.   TNG then can be told to 'generate' thumbnails, and it will not do so if it finds a thumbnail already exists, but creates necessary linkages of the media.  In my case, all data comes from importing gedcom files, but I think this should work for those uploaded media images and directly entering other data into TNG as well.  I never have to resize the original media anymore, except when I wish the viewed image to be smaller on the web.

Ron

Share this post


Link to post
Share on other sites
Craig Arno
On 7/25/2018 at 6:24 PM, tngrlkrz said:

...  I use Easy Thumbnails (a free Windows utility, ...

Ron

Ron, thanks.  I ran into this problem again tonight and tried Easy Thumbnails.  It was easy to configure and worked well.

I still have no idea why TNG wasn't able to convert the two ".jpg" files I received this evening.  The file properties are "Camera Model: iPhone SE", 3024 x 4032 pixels, and I had to rotate using Microsoft Picture Manager 14.0.7010.1000 from Office 2010.

Share this post


Link to post
Share on other sites
theKiwi
14 hours ago, Craig Arno said:

Ron, thanks.  I ran into this problem again tonight and tried Easy Thumbnails.  It was easy to configure and worked well.

I still have no idea why TNG wasn't able to convert the two ".jpg" files I received this evening.  The file properties are "Camera Model: iPhone SE", 3024 x 4032 pixels, and I had to rotate using Microsoft Picture Manager 14.0.7010.1000 from Office 2010.

At 12 megapixels, these images are at the bounds, or outside of what the GD library built in to PHP can handle.

Roger

Share this post


Link to post
Share on other sites
Israel
On 7/25/2018 at 6:24 PM, tngrlkrz said:

Hopefully this is on topic, but, based on other forum threads, I don't believe I am the only user who gets around the thumbnail creation issue by creating the thumbnails offline, on the PC.  I encountered into this TNG thumbnail issue long ago and looked for an alternative.  I use Easy Thumbnails (a free Windows utility, there are other utilities available) for generating all thumbs, then upload them along with the original images to an appropriate media folder.   TNG then can be told to 'generate' thumbnails, and it will not do so if it finds a thumbnail already exists, but creates necessary linkages of the media.  In my case, all data comes from importing gedcom files, but I think this should work for those uploaded media images and directly entering other data into TNG as well.  I never have to resize the original media anymore, except when I wish the viewed image to be smaller on the web.

Ron

Awesome tip, how come I never tought of that, and that software you recommended is free and just what I needed. Thank you.

Share this post


Link to post
Share on other sites
tngrlkrz

Glad it helped you.  It has been a godsend to use the Easy Thumbnails utility.  I don't totally understand why 'generate thumbnails' is necessary to link media after gedcom import, but it must be done that way.

Ron

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×