Web based family history software

This Help forum is for issues relates to the latest release (1.5.x). For issues related to beta or github version please use their own Help forum.
Before asking for help please read "How to request help" by clicking on that tab above here.

Important Error uploading images

  • Hjord
  • Topic Author
  • Visitor
  • Visitor
9 years 6 months ago - 9 years 6 months ago #1 by Hjord
Error uploading images was created by Hjord
Hi

Yesterday I uploaded a lot of images, today I moved them around in different folders, and everything was fine.

But now i get an error when I try to upload a image.
Code:
Fatal error: Uncaught exception 'Exception' with message 'Bad $action () in addmedia.php' in C:\........\webtrees\addmedia.php on line 395 Exception: Bad $action () in addmedia.php in C:\........webtrees\addmedia.php on line 395 Call Stack # Time Memory Function Location 1 0.0020 477440 {main}( ) ..\addmedia.php:0

Some of the images I already uploaded, and was displayed correctly, is just a jpg icon now, and when i click on them it says "This image failed to load"


Any help fixing this would be appreciated.
Last edit: 9 years 6 months ago by Hjord.

Please Log in or Create an account to join the conversation.

More
9 years 6 months ago #2 by fisharebest
Replied by fisharebest on topic Error uploading images

Any help fixing this would be appreciated.


Each media object has a filename/path.

These need to point to a file on disk.

Either edit the path, or move the file.

TIP: I guess you just moved the files on disk. If you let webtrees do this (media object, edit menu), it will keep everything in sync.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • Hjord
  • Topic Author
  • Visitor
  • Visitor
9 years 6 months ago #3 by Hjord
Replied by Hjord on topic Error uploading images
I triple checked, the image path it what it should be.


I've done a bit of testing.
I get the upload error when i'm adding a mediaobject to a source. If i just upload under album, no error :s

Please Log in or Create an account to join the conversation.

  • Hjord
  • Topic Author
  • Visitor
  • Visitor
9 years 6 months ago #4 by Hjord
Replied by Hjord on topic Error uploading images
I've tried to copy a fresh version of addmedia.php into the folder.
But no luck.

Please Log in or Create an account to join the conversation.

  • Hjord
  • Topic Author
  • Visitor
  • Visitor
9 years 6 months ago #5 by Hjord
Replied by Hjord on topic Error uploading images
No one who can help me?

Please Log in or Create an account to join the conversation.

  • ToyGuy
  • Offline
  • Moderator
  • Moderator
  • Live like it's Christmas every day - Santa Stephen
More
9 years 6 months ago #6 by ToyGuy
Replied by ToyGuy on topic Error uploading images
Not with the information you have supplied. Setup, integrity of files and operations of your site is your responsibility. We know the software works, so if it doesn't for you, you have somehow misconfigured your site, the server, or not followed instructions.

While sometimes we can assist with full admin access as well as FTP access, most of us are busy with our own sites, software development and other users, so therefore it is not fair to be at your beck and call.

If you want to set up an account with full admin rights and privileges and send me the access information, I can look at your site. I am not sure what problem you are experiencing. Unable to attach an image to a source? Where are you trying to do this? At the event/fact entry or from the source listing? Do you have one of the two image tabs (media and album) disabled?

Santa Stephen the Fabled Santa
Latest webtrees at MyArnolds.com
Hosted by webtreesonline.com , a division of GeneHosts LLC
MacOS 10.6.8, Apache 2.2+, PHP 5.4.16, MySQL 5.5.28

Please Log in or Create an account to join the conversation.

  • Hjord
  • Topic Author
  • Visitor
  • Visitor
9 years 6 months ago #7 by Hjord
Replied by Hjord on topic Error uploading images

Not with the information you have supplied.

Sorry about that, I did not know what you need.

Setup, integrity of files and operations of your site is your responsibility. We know the software works, so if it doesn't for you, you have somehow misconfigured your site, the server, or not followed instructions.

Yea, I know.

While sometimes we can assist with full admin access as well as FTP access, most of us are busy with our own sites, software development and other users, so therefore it is not fair to be at your beck and call.

If you want to set up an account with full admin rights and privileges and send me the access information, I can look at your site.

Admin rights or ftp access will not help atm, my site is not live yet. It's not accessible over the internet.

Unable to attach an image to a source? Where are you trying to do this? At the event/fact entry or from the source listing? Do you have one of the two image tabs (media and album) disabled?

I'm adding a birth to a person - add a new source citation - add new media object.
After i've chosen the picture to upload and the other preferences and click save, the error appears when it's almost finish uploading.
The media tab is disabled.

Please Log in or Create an account to join the conversation.

More
9 years 6 months ago - 9 years 6 months ago #8 by Jackie
Replied by Jackie on topic Error uploading images

Hjord wrote: Hi
Yesterday I uploaded a lot of images, today I moved them around in different folders, and everything was fine.
But now i get an error when I try to upload a image.

Code:
Fatal error: Uncaught exception 'Exception' with message 'Bad $action () in addmedia.php' in C:\........\webtrees\addmedia.php on line 395 Exception: Bad $action () in addmedia.php in C:\........webtrees\addmedia.php on line 395 Call Stack # Time Memory Function Location 1 0.0020 477440 {main}( ) ..\addmedia.php:0

Some of the images I already uploaded, and was displayed correctly, is just a jpg icon now, and when i click on them it says "This image failed to load"
Any help fixing this would be appreciated.


Hello Hjord,

You mentionned *This image failed to load*. A frequent reason why an image fails to load is its dimensions and weight. Could you tell us the size and the resolution of your image? Could you tell us what memory is allocated to your website? I see in your post Time = 0.0020 this is only 20 sec. Memory = 477440. That does not seem to be enough...

Would you please go to :
Administration -> PHP information -> go down the page until you'll see *Core* section -> you should see two columns, (the left one is your webtrees settings, the right one is the server allocation limit) -> look for *Memory limit* -> What do you have?

Attachments:
Last edit: 9 years 6 months ago by Jackie.

Please Log in or Create an account to join the conversation.

More
9 years 6 months ago - 9 years 6 months ago #9 by Jackie
Replied by Jackie on topic Error uploading images

fisharebest wrote: Each media object has a filename/path.
These need to point to a file on disk.
Either edit the path, or move the file.
TIP: I guess you just moved the files on disk. If you let webtrees do this (media object, edit menu), it will keep everything in sync.


Hello Hjord,

As Greg said: *Either edit the path, or move the file*. webtrees can do that for you.

Go to Administration -> Media -> you should see all your media listed there

EDIT : Add an image

Attachments:
Last edit: 9 years 6 months ago by Jackie.

Please Log in or Create an account to join the conversation.

  • Hjord
  • Topic Author
  • Visitor
  • Visitor
9 years 6 months ago - 9 years 6 months ago #10 by Hjord
Replied by Hjord on topic Error uploading images

You mentionned *This image failed to load*. A frequent reason why an image fails to load is its dimensions and weight. Could you tell us the size and the resolution of your image?

Those pictures was displayed correctly earlier.
One of them was 4002x3225px at 330kb.

Administration -> PHP information -> go down the page until you'll see *Core* section -> you should see two columns, (the left one is your webtrees settings, the right one is the server allocation limit) -> look for *Memory limit* -> What do you have?

Is this it?
Code:
max_execution_time 120 max_file_uploads 20 max_input_nesting_level 64 max_input_time 60 max_input_vars 2500 memory_limit 128M
It says the same thing on both sides for all of them
Last edit: 9 years 6 months ago by Hjord.

Please Log in or Create an account to join the conversation.

More
9 years 6 months ago #11 by Jackie
Replied by Jackie on topic Error uploading images
Thank you Hjord for your reply.

One of them was 4002x3225px at 330kb.


This is absolutely too large!! For example, most of my images are about 400px to 600px large and make less than 100KB

Please Log in or Create an account to join the conversation.

More
9 years 6 months ago #12 by Jackie
Replied by Jackie on topic Error uploading images
Hello Hjord,

May I suggest you to read the Wiki page Media Management? Even though it is only a draft, it contains a lot of good advices that could help you.

wiki.webtrees.net/en/Media_Management

Please Log in or Create an account to join the conversation.

More
9 years 6 months ago - 9 years 6 months ago #13 by Jackie
Replied by Jackie on topic Error uploading images
Hello Hjord,

Those pictures was displayed correctly earlier.


But you moved thoses pictures. HOW did you move them? Where did you move them? Did you change the path to your media after moving them?

By default, webtrees is set to follow the path:
../yoursite/data/media/

if you moved your images to
../yoursite/data/newfolder/

then webtrees does not know about that newfolder.

Go to Administration -> Family trees -> Your family tree -> Media tab -> and set the new path there
Last edit: 9 years 6 months ago by Jackie.

Please Log in or Create an account to join the conversation.

  • Hjord
  • Topic Author
  • Visitor
  • Visitor
9 years 6 months ago #14 by Hjord
Replied by Hjord on topic Error uploading images
Thank you for your help.

Okay, I see how that could be too much.
But is there some kind of limit somewhere?
I like to keep the files in the original size.
I have uploaded pictures over 800kb in size before, no problem.
No one though, with that resolution.

Please Log in or Create an account to join the conversation.

  • Hjord
  • Topic Author
  • Visitor
  • Visitor
9 years 6 months ago #15 by Hjord
Replied by Hjord on topic Error uploading images

Jackie wrote: Hello Hjord,

Those pictures was displayed correctly earlier.


But you moved thoses pictures. HOW did you move them? Where did you move them? Did you change the path to your media after moving them?

By default, webtrees is set to follow the path:
../yoursite/data/media/

if you moved your images to
../yoursite/data/newfolder/

then webtrees does not know about that newfolder.

Go to Administration -> Family trees -> Your family tree -> Media tab -> and set the new path there


I moved them directly on the drive to a subfolder inside the media folder, and changed the path after.
Every picture was displayed correctly, but only for a while.
And only, some of the pictures 'broke' - others still works.

Please Log in or Create an account to join the conversation.

More
9 years 6 months ago - 9 years 6 months ago #16 by Jackie
Replied by Jackie on topic Error uploading images

But is there some kind of limit somewhere?


Well, all depends on your webhost contract. If you have unlimited storage then it is fine. Though you have to think about your visitors Web connection, and Web usage. Why would you waste bandwidth of others?

People never think about the cost of bandwidth, they don't realise that the more we use, the more companies raise their price to access Internet.
Last edit: 9 years 6 months ago by Jackie.

Please Log in or Create an account to join the conversation.

  • Hjord
  • Topic Author
  • Visitor
  • Visitor
9 years 6 months ago - 9 years 6 months ago #17 by Hjord
Replied by Hjord on topic Error uploading images
I'm self hosting - so kind of unlimited.

It's not the plan to have alot of users, but if it's gonna be a problem i can always resize the pictures later.
But a picture of 800kb should still load almost instantly on a slow connection.
Where I am, the internet price have never raised.


I just tried to upload a small image, it seems to work just fine. Yay! (:
Is there a way to get it to accept larger files?
Last edit: 9 years 6 months ago by Hjord.

Please Log in or Create an account to join the conversation.

  • ToyGuy
  • Offline
  • Moderator
  • Moderator
  • Live like it's Christmas every day - Santa Stephen
More
9 years 6 months ago #18 by ToyGuy
Replied by ToyGuy on topic Error uploading images
1) An 800K image file (JPG) could actually be masking a file as large as 3.5mb when expanded and for making a thumbnail, many times that size.
Perhaps you need to increase your assigned memory to PHP?
Perhaps you need to increase your assigned memory to webtrees?
Perhaps you need to modify your PHP.ini to allow images larger than the current size (maybe only 2mb, but default is usually 4mb)?

If you are trying to self-host, perhaps you need to know more about running a server?
Perhaps you need to read the WIKI about optimization of SQL and memory requirements?

Santa Stephen the Fabled Santa
Latest webtrees at MyArnolds.com
Hosted by webtreesonline.com , a division of GeneHosts LLC
MacOS 10.6.8, Apache 2.2+, PHP 5.4.16, MySQL 5.5.28

Please Log in or Create an account to join the conversation.

More
9 years 6 months ago #19 by fisharebest
Replied by fisharebest on topic Error uploading images
The size (in KB) is not the problem.

The size in pixels can cause a problem. JPEG is a compressed format. To create a thumbnail, webtrees must uncompress the image.

4002x3225 pixels will require 4002 x 3225 x 4 = 52MB

You must configure PHP to allow scripts to use more than this. The default for many hosts is only 32MB.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • Hjord
  • Topic Author
  • Visitor
  • Visitor
9 years 6 months ago #20 by Hjord
Replied by Hjord on topic Error uploading images
When i talked about the size it was connection wise, not about decompressing.

It seems like I fixed the problem.
Thank you everyone (:

If you are trying to self-host, perhaps you need to know more about running a server?

I think I know plenty about running a server, but i know nothing about php.
Perhaps you need to use the word perhaps a little bit less.

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
}