F-spot error: Value is greater than Int32.MaxValue or less than Int32.MinValue

Bug #636819 reported by Leon
36
This bug affects 7 people
Affects Status Importance Assigned to Milestone
f-spot (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: f-spot

When I open f-spot before I can use it I get this error:

An unhandled exception was thrown: Value is greater than Int32.MaxValue or less than Int32.MinValue

  at System.Convert.ToInt32 (Int64 value) [0x00000] in <filename unknown>:0
  at System.Int64.System.IConvertible.ToInt32 (IFormatProvider provider) [0x00000] in <filename unknown>:0
  at System.Convert.ToType (System.Object value, System.Type conversionType, IFormatProvider provider, Boolean try_target_to_type) [0x00000] in <filename unknown>:0
  at System.Convert.ChangeType (System.Object value, System.Type conversionType, IFormatProvider provider) [0x00000] in <filename unknown>:0
  at Mono.Data.Sqlite.Sqlite3.GetValue (Mono.Data.Sqlite.SqliteStatement stmt, Int32 index, Mono.Data.Sqlite.SqliteType typ) [0x00000] in <filename unknown>:0
  at Mono.Data.Sqlite.SqliteDataReader.GetValue (Int32 i) [0x00000] in <filename unknown>:0
  at Hyena.Data.Sqlite.HyenaSqliteArrayDataReader.ReadAllRows (Mono.Data.Sqlite.SqliteDataReader reader) [0x00000] in <filename unknown>:0
  at Hyena.Data.Sqlite.HyenaSqliteArrayDataReader..ctor (Mono.Data.Sqlite.SqliteDataReader reader) [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) Hyena.Data.Sqlite.HyenaSqliteArrayDataReader:.ctor (Mono.Data.Sqlite.SqliteDataReader)
  at Hyena.Data.Sqlite.HyenaSqliteCommand.Execute (Hyena.Data.Sqlite.HyenaSqliteConnection hconnection, Mono.Data.Sqlite.SqliteConnection connection) [0x00000] in <filename unknown>:0

.NET Version: 2.0.50727.1433
OS Version: Unix 2.6.35.20

Assembly Version Information:

glade-sharp (2.12.0.0)
FSpot.Bling (0.7.0.0)
TagLib (0.7.0.0)
pango-sharp (2.12.0.0)
FSpot.Query (0.7.0.0)
gtk-sharp-beans (2.14.0.0)
gnome-sharp (2.24.0.0)
System.Transactions (2.0.0.0)
System.Data (2.0.0.0)
Mono.Data.Sqlite (0.7.0.0)
Hyena.Data.Sqlite (0.7.0.0)
FSpot.JobScheduler (0.7.0.0)
System.Core (3.5.0.0)
unique-sharp (1.0.0.0)
System.Configuration (2.0.0.0)
FSpot.Gui (0.7.0.0)
System.Xml (2.0.0.0)
Mono.Addins (0.4.0.0)
Mono.Addins.Setup (0.4.0.0)
gconf-sharp (2.24.0.0)
Hyena.Gui (0.7.0.0)
atk-sharp (2.12.0.0)
System (2.0.0.0)
gtk-sharp (2.12.0.0)
FSpot.Cms (0.7.0.0)
FSpot.Core (0.7.0.0)
FSpot.Platform (0.7.0.0)
Mono.Posix (2.0.0.0)
gdk-sharp (2.12.0.0)
Hyena (0.7.0.0)
glib-sharp (2.12.0.0)
FSpot.Utils (0.7.0.0)
f-spot (0.7.0.0)
mscorlib (2.0.0.0)

Platform Information: Linux 2.6.35-20-generic x86_64 unknown GNU/Linux

Disribution Information:

[/etc/lsb-release]
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.10
DISTRIB_CODENAME=maverick
DISTRIB_DESCRIPTION="Ubuntu maverick (development branch)"

[/etc/debian_version]
squeeze/sid

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: f-spot 0.7.2-1
ProcVersionSignature: Ubuntu 2.6.35-20.29-generic 2.6.35.4
Uname: Linux 2.6.35-20-generic x86_64
NonfreeKernelModules: wl
Architecture: amd64
Date: Mon Sep 13 07:12:44 2010
ExecutablePath: /usr/lib/f-spot/f-spot.exe
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Beta amd64 (20100901.1)
InterpreterPath: /usr/bin/mono
ProcEnviron:
 SHELL=/bin/bash
 LANG=en_US.UTF-8
SourcePackage: f-spot

Revision history for this message
Leon (leonbo) wrote :
Revision history for this message
Håkon M.E. Sundaune (haakon-sundaune) wrote :

I get this too, starting two days ago:

En uhåndtert feil oppstod: Value is greater than Int32.MaxValue or less than Int32.MinValue

  at System.Convert.ToInt32 (Int64 value) [0x00000]
  at System.Int64.System.IConvertible.ToInt32 (IFormatProvider provider) [0x00000]
  at System.Convert.ToType (System.Object value, System.Type conversionType, IFormatProvider provider, Boolean try_target_to_type) [0x00000]
  at System.Convert.ChangeType (System.Object value, System.Type conversionType, IFormatProvider provider) [0x00000]
  at Mono.Data.Sqlite.Sqlite3.GetValue (Mono.Data.Sqlite.SqliteStatement stmt, Int32 index, Mono.Data.Sqlite.SqliteType typ) [0x00000]
  at Mono.Data.Sqlite.SqliteDataReader.GetValue (Int32 i) [0x00000]
  at Hyena.Data.Sqlite.HyenaSqliteArrayDataReader.ReadAllRows (Mono.Data.Sqlite.SqliteDataReader reader) [0x00000]
  at Hyena.Data.Sqlite.HyenaSqliteArrayDataReader..ctor (Mono.Data.Sqlite.SqliteDataReader reader) [0x00000]
  at (wrapper remoting-invoke-with-check) Hyena.Data.Sqlite.HyenaSqliteArrayDataReader:.ctor (Mono.Data.Sqlite.SqliteDataReader)
  at Hyena.Data.Sqlite.HyenaSqliteCommand.Execute (Hyena.Data.Sqlite.HyenaSqliteConnection hconnection, Mono.Data.Sqlite.SqliteConnection connection) [0x00000]

.NET Version: 2.0.50727.1433
OS Version: Unix 2.6.32.24

Assembly Version Information:

Mono.Cairo (2.0.0.0)
FSpot.Bling (0.7.0.0)
TagLib (0.7.0.0)
pango-sharp (2.12.0.0)
FSpot.Query (0.7.0.0)
gtk-sharp-beans (2.14.0.0)
gnome-sharp (2.24.0.0)
System.Transactions (2.0.0.0)
System.Data (2.0.0.0)
Mono.Data.Sqlite (0.7.0.0)
Hyena.Data.Sqlite (0.7.0.0)
FSpot.JobScheduler (0.7.0.0)
System.Core (3.5.0.0)
unique-sharp (1.0.0.0)
System.Configuration (2.0.0.0)
FSpot.Gui (0.7.0.0)
System.Xml (2.0.0.0)
Mono.Addins (0.4.0.0)
gio-sharp (2.14.0.0)
gconf-sharp (2.24.0.0)
Hyena.Gui (0.7.0.0)
atk-sharp (2.12.0.0)
System (2.0.0.0)
Mono.Addins.Setup (0.4.0.0)
gtk-sharp (2.12.0.0)
FSpot.Cms (0.7.0.0)
FSpot.Core (0.7.0.0)
FSpot.Platform (0.7.0.0)
Mono.Posix (2.0.0.0)
gdk-sharp (2.12.0.0)
Hyena (0.7.0.0)
glib-sharp (2.12.0.0)
FSpot.Utils (0.7.0.0)
f-spot (0.7.0.0)
mscorlib (2.0.0.0)

Platform Information: Linux 2.6.32-24-generic i686 unknown GNU/Linux

Disribution Information:

[/etc/lsb-release]
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04.1 LTS"

[/etc/debian_version]
squeeze/sid

Revision history for this message
Håkon M.E. Sundaune (haakon-sundaune) wrote :

Output of f-spot --debug &> f-spot-debug.txt

Revision history for this message
Håkon M.E. Sundaune (haakon-sundaune) wrote :

I suspect the error message and crash being due to some pictures in my database having date stamps in the future.

Any quick fixes for adjusting dates in the future to, say, todays date then?

Revision history for this message
Mirek (mirek-ms-soft) wrote :

I can confirm that changing future date (whose timestamp is greater than 32 bit signed integer) to smaller value solves the problem.
To change the date, edit FSpot database (in my case it was ~/.config/f-spot/photos.db) with sqlite manager and execute the following query:

update photos set time=[new_timestamp_which_is_less_then_max_int32] where id=[id_of_photo_in_question]

If you have many photos with wrong timestamp, you can try to modify the above query to update all of them at once e.g.:

update photos set time=[new_timestamp_which_is_less_then_max_int32] where time > 2000000000

Revision history for this message
Håkon M.E. Sundaune (haakon-sundaune) wrote :

Thank you. I've been playing around with it, and it makes f-spot happy. But then again, ofcourse it doesn't change the info in the image file itself, it just mends the database (photos.db) so that f-spot won't hiccup.

Perhaps f-spot should handle image files with time stamps wrongfully in the future in a more graceful way? I have this nagging feeling f-spot shifted the time of those photos in the first place, but I'm not intelligent enough to debug it.

What I am researching now is a shell script that will conditionally set ALL date fields to a given time (say, todays date) if the existing one is in the future.

Revision history for this message
Derek (bugs-m8y) wrote :

I ran into this as well after an import of 350 photos off of an iphone 4 into a brand new ubuntu install.
sqlite> select count(*) from photos where time < 0;
134

In this case, the photos apparently had a negative time.
update photos set time=0 where time < 0;

fixed it for me.
There were no photos with >maxint.
I may have to put this fix into a shell script.

Thank you for pinpointing the problem.

Revision history for this message
Håkon M.E. Sundaune (haakon-sundaune) wrote :

The real problem, of course, is that f-spot PERMANENTLY changes date information in pictures, thereby corrupting them. An example:

1. Picture 0001.JPG is taken on 29th of May 2010 (29-05-10)
2. Picture is imported into f-spot with option "Copy to image folder"

Expected behaviour would be:

- Place image in new folder: ~/Images/2010/05/29/0001.JPG

But the real behaviour is:

- Place image in new folder: ~/Images/2029/05/10/0001.JPG

This will, in the cases where the corrupted year is too far in the future, crash F-spot and mess up your database. As if this isn't bad enough, f-spot will also PERMANENTLY alter the metadata information in 0001.JPG, so the date will still be corrupted even if you import your pictures into another program.

Just a warning.

Revision history for this message
Derek (bugs-m8y) wrote :

https://bugzilla.gnome.org/show_bug.cgi?id=634930

This remote bug watch was in the (probably duplicate) bug #678245 - mentioning it here for reference sake.

Thanks for the warning on the date corruption.

Revision history for this message
Derek (bugs-m8y) wrote :

Hm. I guess I could try using exiftool and its rather powerful manipulation of (most likely) createdate to fix this.
Along with a directory rename.
Along with the sqlite3 commands.
Of course, at this point the whole thing is getting rather complex. Hopefully f-spot pushes out an emergency fix.
Is a rather high-profile app given it is recommended when people plug in their iFoos and cameras.

Revision history for this message
Derek (bugs-m8y) wrote :

f-spot dev reports it is:
https://bugzilla.gnome.org/show_bug.cgi?id=626699

And that bug #678245 is indeed duplicate.

Also that it is fixed in 0.8.2 and that (Håkon M.E. Sundaune should be pleased about this) it no longer modifies photo metadata but rather uses a sidecar file.

Hopefully a backport into 10.10 will be forthcoming.

Revision history for this message
Håkon M.E. Sundaune (haakon-sundaune) wrote :

I am pleased to see that, yes, but I still don't understand what's going on. Here's the output of 'exiv2 test.jpg': for the first of two example images:

hakonau@VOSTRO-ubuntu:~/Desktop$ exiv2 test.jpg
Filnavn : test.jpg
Fil størrelse : 662165 Byte
MIME-type : image/jpeg
Bildestørrelse : 2592 x 1944
Kameratype : Sony Ericsson
Kameramodell : U20i
Bildets tidsstempel: 2010:09:30 14:09:15
Image number :
Lukketid : 1/60 s
Aperture :
Exposure bias :
Flash : No flash
Flash bias :
Focal length :
Avstand til motiv:
ISO speed : 40
Exposure mode :
Målemetode :
Macro mode :
Bildekvalitet :
Exif Oppløsning: 2592 x 1944
Hvitbalanse : Automatisk
Miniatyrbilde : Ingen
Opphavsrett :
Exif kommentar :

It is Norwegian, but you can see the time stamp: 2010:09:30 14:09:15

Now for the other image, test2.jpg:

hakonau@VOSTRO-ubuntu:~/Desktop$ exiv2 test2.jpg
Filnavn : test2.jpg
Fil størrelse : 3476572 Byte
MIME-type : image/jpeg
Bildestørrelse : 3072 x 2304
Kameratype : Samsung Techwin
Kameramodell : <KENOX S760 / Samsung S760>
Bildets tidsstempel: 2009:03:08 16:03:21
Image number :
Lukketid : 1/45 s
Aperture : F3.1
Exposure bias : 0 EV
Flash : Yes, auto, red-eye reduction
Flash bias :
Focal length : 8.1 mm (35 mm ekvivalent: 49.0 mm)
Avstand til motiv:
ISO speed : 100
Exposure mode : Automatisk
Målemetode : Multi-segment
Macro mode :
Bildekvalitet :
Exif Oppløsning: 3072 x 2304
Hvitbalanse : Automatisk
Miniatyrbilde : Ingen
Opphavsrett : COPYRIGHT, 2007
Exif kommentar :

The first image is imported into F-spot using 10th of September 1930 as the date, the second one (correctly) uses 8th of March 2009. Luckily the metadata itself hasn't been corrupted this time, but I can't possibly go through 4,000 photos to check whether their correct date is 03-04-05 or 05-04-03.

So even though I'm happy to hear that f-spot won't alter metadata anymore it was a little too late for me, I'm afraid :)

Revision history for this message
Derek (bugs-m8y) wrote :

Well, going through 4,000 images sounds like a perfect task for a script. :)

Just use exiftool or your thingy above, and if the dates are severely outside a certain range (like past 10 years) then swap the 2 digit year and the day and write it back, since it seems like that is what happened.

I mean, in the interests of data recovery.

Revision history for this message
Håkon M.E. Sundaune (haakon-sundaune) wrote : Re: [Bug 636819] Re: F-spot error: Value is greater than Int32.MaxValue or less than Int32.MinValue

I would... but my scripting skills aren't up for the task *blush*

On 28. jan. 2011 23:18, Derek wrote:
> Well, going through 4,000 images sounds like a perfect task for a
> script. :)
>
> Just use exiftool or your thingy above, and if the dates are severely
> outside a certain range (like past 10 years) then swap the 2 digit year
> and the day and write it back, since it seems like that is what
> happened.
>
> I mean, in the interests of data recovery.
>

Revision history for this message
Stjepan Brbot (stjepan-brbot) wrote :

I had the same problem, but it seems that it has been solved in 0.8.2 version of F-Spot.

Use F-Spot's PPA for update: https://launchpad.net/~f-spot/+archive/f-spot-ppa

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in f-spot (Ubuntu):
status: New → Confirmed
B Bobo (yout-bobo123)
tags: added: f-spot
Changed in f-spot (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.