Module: Raw Photo Support

chadparry
chadparry's picture

Joined: 2008-05-30
Posts: 38
Posted: Thu, 2012-11-08 00:13

@leonki, that's a fine way to solve this problem. When I was considering writing that fix, there was another option I was considering that might be even easier. You could keep a database table of mappings from current names to old names. So the file would be stored at original/ABC.jpeg like it is currently, but then the table would have a row for "ABC.jpeg | ABC.DNG". If the original name and the current name are the same, then no row would be inserted. (This would allow backwards compatibility, since none of the legacy original files would have a row in that table).

Either way to do it would be fine, I think. Just choose whichever will be the least amount of effort.

 
leonki

Joined: 2010-12-18
Posts: 32
Posted: Thu, 2012-11-08 05:16

I was thinking of the table approach, but it has a few flaws that turned me off:

- performance (SQL queries are much slower that quick file/directory checks in PHP)
- disaster recovery - if your database gets corrupt, it's hard to recover DNG/TIFF files, where as a simply rsync to S3 mounted FS is a quick and dirty backup that will contain all the information one requires to get the originals back.

I'll need to walk the code path to better understand the order of things being done, before I put in my hooks. Also, is it fair to assume that a user has no access to original/ through the web? It's simply for backup purposes if the owner has direct filesystem access? (i.e. clicking "view fullsize" does not load images from original/)

 
deanshavit

Joined: 2012-09-28
Posts: 23
Posted: Wed, 2013-02-13 19:50

I've got Gallery 3.0.4, KeepOriginal, and Raw Photo support. I'm able to add .NEF files, but the oddest thing is happening. The file in "Originals" is being resized, resolution wise, to the size of the Thumbnail, even though the file size itself isn't changing. I'd appreciate any pointers, because even with all of the info intact, this change in resolution isn't "Original" at all.

 
Kamenko
Kamenko's picture

Joined: 2002-11-30
Posts: 14
Posted: Mon, 2013-04-01 20:07

I have Gallery 3.0.5 and I installed rawphoto module v.3
When I try to add .NEF (Nikon D50) image using server add I don't get any error message but photo doesn't get uploaded into the album.
When I use "Add photos" link I get error: "DSC_1454.NEF - Unable to process this photo", without any more explanations why failed.
I have ImageMagick version 6.6.0-4 and "dcraw" v8.99 installed and working properly.

What can I do to find out what is happening and to see/look for any error messages that will tell me more

Thanks

 
chadparry
chadparry's picture

Joined: 2008-05-30
Posts: 38
Posted: Tue, 2013-04-02 05:02

@Kamenko, the error messages are rarely shown on the webpage, because making error messages public is usually considered a security flaw. The detailed error messages will be in the log files on the server. See http://codex.galleryproject.org/Gallery3:User_guide:Gallery3:Troubleshooting#Log_files. Try re-creating the error and the check for the most recent messages in the logs.

 
ssotangkur

Joined: 2006-11-20
Posts: 1
Posted: Sun, 2013-04-14 11:37

If I have a Gallery2 installation with lots of raw images, then setup G3 w/ rawphoto, will I be able to do a G2->G3 import and get all my raw photos (CR2) and albums onto G3? A lot of us still use G2 because of the lack of raw support. The G2->G3 import module makes no mention of raw images.

 
xarope

Joined: 2012-01-26
Posts: 10
Posted: Fri, 2013-05-03 04:04

I'm trying to use this module to upload TIFFs. Firstly, to get the module to allow tiffs, I had to modify function legal_photo_extensions in raw_photo_event.php, and added "tiff" to the extensions array.

Secondly, when I then try to upload a small tiff (~500K), I then get a "Server error: Error #2038 (IO)" (and sometimes just "Unable to process this photo"), and the var/log shows this:

Quote:
2013-05-03 03:48:31 +00:00 --- error: ORM Validation has failed for items model
#0 /var/www/gallery3/system/libraries/ORM.php(755): ORM_Validation_Exception_Core::handle_validation('items', Object(Validation))
#1 /var/www/gallery3/modules/gallery/models/item.php(887): ORM_Core->validate(NULL)
#2 /var/www/gallery3/system/libraries/ORM.php(778): Item_Model_Core->validate()
#3 /var/www/gallery3/modules/gallery/libraries/MY_ORM.php(34): ORM_Core->save()
#4 /var/www/gallery3/modules/gallery/libraries/ORM_MPTT.php(76): ORM->save()
#5 /var/www/gallery3/modules/gallery/models/item.php(390): ORM_MPTT_Core->save()
#6 /var/www/gallery3/modules/gallery/controllers/uploader.php(75): Item_Model_Core->save()
#7 [internal function]: Uploader_Controller->add_photo('1234')
#8 /var/www/gallery3/system/core/Kohana.php(331): ReflectionMethod->invokeArgs(Object(Uploader_Controller), Array)
#9 [internal function]: Kohana_Core::instance(NULL)
#10 /var/www/gallery3/system/core/Event.php(208): call_user_func_array(Array, Array)
#11 /var/www/gallery3/application/Bootstrap.php(67): Event_Core::run('system.execute')
#12 /var/www/gallery3/index.php(116): require('/tankGallery/ga...')
#13 {main}
2013-05-03 03:48:31 +00:00 --- error: Validation errors: Array
(
[name] => invalid_data_file
)

I've checked the FAQ and googled for error #2308, and the answers don't seem to apply here: this is an internal server, so no firewall in-between, and php settings for memory+file upload sizes are fine (I can upload much larger jpegs with no issue)

My platform is ubuntu 12.04.2 LTS, gallery3 v3.0.7, dcraw is v8.99, graphicsmagick is 1.3.12 (I also installed the graphicsmagick imagemagick script compatiblity package, which allows scripts from imagemagick to run without change e.g. "convert" instead of "gm convert").

rawphoto version from module.info is v3.

I also tried a raw photo from http://rawsamples.ch/index_en.php, "RAW_SONY_A100,ARW" which is ~9MB, same error message, so maybe the module isn't working properly in my installation?
Anything I missed out?

 
chadparry
chadparry's picture

Joined: 2008-05-30
Posts: 38
Posted: Fri, 2013-05-03 08:36

@xarope, the reason the ".tiff" extension wasn't in the array already was because this module does not support the TIFF format. This module only supports RAW photos, specifically the formats supported by dcraw. Those files are typically created by digital cameras.

I'm not sure why you are trying to use this module with TIFF files. I would humbly suggest that you're not using the right tool for the job.

 
xarope

Joined: 2012-01-26
Posts: 10
Posted: Fri, 2013-05-03 09:43

thanks for replying, chadparry. I was wondering if I was doing this right; I just wanted to be able to upload TIFFs as with G2, and it's been frustrating trying to find the right module to do so in G3. I thought dcraw could handle tiffs but realised I got confused with gm convert/convert (too much testing!).

Just out of curiosity, I took out my minor edit to the array, but still couldn't load that Sony raw file, did I have to make any other changes to get this module to work with supported raw files?

 
chadparry
chadparry's picture

Joined: 2008-05-30
Posts: 38
Posted: Fri, 2013-05-03 12:01

@xarope, the Sony RAW files should work fine. At one time I tested with all the samples on that site and everything worked. If you've been making changes to the module, you may want to reinstall it, to ensure you have a clean copy.

 
xarope

Joined: 2012-01-26
Posts: 10
Posted: Mon, 2013-05-06 04:54

I made a new install of gallery3 (3.0.7), i.e. new apache site, new database, no pictures, with only the rawphoto module installed, but I still get this error in var/logs when I try to upload a RAW file (this time I tried both the sony one as well as http://www.rawsamples.ch/raws/panasonic/lx3/RAW_PANASONIC_LX3.RW2):

Quote:
#0 /var/www/galleryraw/system/libraries/ORM.php(755): ORM_Validation_Exception_Core::handle_validation('items', Object(Validation))
#1 /var/www/galleryraw/modules/gallery/models/item.php(887): ORM_Core->validate(NULL)
#2 /var/www/galleryraw/system/libraries/ORM.php(778): Item_Model_Core->validate()
#3 /var/www/galleryraw/modules/gallery/libraries/MY_ORM.php(34): ORM_Core->save()
#4 /var/www/galleryraw/modules/gallery/libraries/ORM_MPTT.php(76): ORM->save()
#5 /var/www/galleryraw/modules/gallery/models/item.php(390): ORM_MPTT_Core->save()
#6 /var/www/galleryraw/modules/gallery/controllers/uploader.php(75): Item_Model_Core->save()
#7 [internal function]: Uploader_Controller->add_photo('1')
#8 /var/www/galleryraw/system/core/Kohana.php(331): ReflectionMethod->invokeArgs(Object(Uploader_Controller), Array)
#9 [internal function]: Kohana_Core::instance(NULL)
#10 /var/www/galleryraw/system/core/Event.php(208): call_user_func_array(Array, Array)
#11 /var/www/galleryraw/application/Bootstrap.php(67): Event_Core::run('system.execute')
#12 /var/www/galleryraw/index.php(116): require('/tankGallery/ga...')
#13 {main}
2013-05-06 04:50:56 +00:00 --- error: Validation errors: Array
(
[name] => invalid_data_file
)

If I upload some normal JPEGs and PNGs, they work fine.

Did you have this working with 3.0.7? I will try an older version of gallery3 just in case. Alternatively there's some problem with my server install, but I just server_add'd about 5000 JPEGs into the "production" apache site over the last few weeks, so from a functional perspective it's working, unless it's related to dcraw itself?

 
alivin70

Joined: 2013-04-03
Posts: 13
Posted: Wed, 2013-05-08 09:29

I recently uploaded a plugin for TIFFs

http://galleryproject.org/node/111441

 
chadparry
chadparry's picture

Joined: 2008-05-30
Posts: 38
Posted: Wed, 2013-05-08 10:09

@xarope, the version of Gallery I used was 3.0.2, IIRC. You might want to search your installation for the "invalid_data_file" error, so at least you know whether the error was coming from a file in the Raw Photos module or Gallery core.

 
xarope

Joined: 2012-01-26
Posts: 10
Posted: Thu, 2013-05-09 02:02
alivin70 wrote:
I recently uploaded a plugin for TIFFs

http://galleryproject.org/node/111441

Thanks alivin70, I'll take a look. Just out of curiousity, does this work with server_add or just individual add photos?

 
xarope

Joined: 2012-01-26
Posts: 10
Posted: Thu, 2013-05-09 02:03
chadparry wrote:
@xarope, the version of Gallery I used was 3.0.2, IIRC. You might want to search your installation for the "invalid_data_file" error, so at least you know whether the error was coming from a file in the Raw Photos module or Gallery core.

Unfortunately I had to delete the test install, so I can't check any further. I'll try again in the future when I have the chance to, thanks again for your suggestions.

 
nmuhlbauer

Joined: 2013-06-01
Posts: 2
Posted: Sat, 2013-06-01 04:52

I'm running ito this same issue. I had Gallery 3.04 and everything worked (raw photos, keep orig, etc...) but after the upgrade to 3.07 the raw photos do not upload. Regular jpgs are fine. I get an error on single file uploads, but server adds do not work either. (Server add shows successful, but no photo is added. The associated jpgs that should be created are not present in any of the folders.)

The error log shows a validation failure:

2013-06-01 04:26:57 +00:00 --- error: ORM Validation has failed for items model
#0 /photos/gallery/system/libraries/ORM.php(755): ORM_Validation_Exception_Core::handle_validation('items', Object(Validation))
#1 /photos/gallery/modules/gallery/models/item.php(887): ORM_Core->validate(NULL)
#2 /photos/gallery/system/libraries/ORM.php(778): Item_Model_Core->validate()
#3 /photos/gallery/modules/gallery/libraries/MY_ORM.php(34): ORM_Core->save()
#4 /photos/gallery/modules/gallery/libraries/ORM_MPTT.php(76): ORM->save()
#5 /photos/gallery/modules/gallery/models/item.php(390): ORM_MPTT_Core->save()
#6 /photos/gallery/modules/gallery/controllers/uploader.php(75): Item_Model_Core->save()
#7 [internal function]: Uploader_Controller->add_photo('46956')
#8 /photos/gallery/system/core/Kohana.php(331): ReflectionMethod->invokeArgs(Object(Uploader_Controller), Array)
#9 [internal function]: Kohana_Core::instance(NULL)
#10 /photos/gallery/system/core/Event.php(208): call_user_func_array(Array, Array)
#11 /photos/gallery/application/Bootstrap.php(67): Event_Core::run('system.execute')
#12 /photos/gallery/index.php(116): require('/photos/gallery...')
#13 {main}
2013-06-01 04:26:57 +00:00 --- error: Validation errors: Array
(
[name] => invalid_data_file
)

I'm guessing there's a compatibility issue here between the new gallery core code and this module. I'm not a code guy by any stretch of the immagination, but I'm willing to help figure this out any way I can. Just tell me what to check... As a last resort, I have this running on a VM with a pre-upgrade snapshot, so I can roll back, but I've added a lot of photos since then.

Thanks for any help you can provide,

Nick