Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to Access Photos from MySQL Database?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Feltpad Incorporated  
View profile  
 More options Jan 30 2012, 12:24 pm
From: Feltpad Incorporated <feltpad...@gmail.com>
Date: Mon, 30 Jan 2012 09:24:15 -0800 (PST)
Local: Mon, Jan 30 2012 12:24 pm
Subject: How to Access Photos from MySQL Database?
We have installed ODK Aggregate and we are using a MySQL Database.

I can see the data inside the _PHOTO_BIN, _PHOTO_BN, and PHOTO_REF
tables - but how do I read this data and display the image? I see in
the _PHOTO_BN table there is a field named UNROOTED_FILE_PATH which
contains a .jpg filename, but I don't know if this can actually be
used to access the image?

Thank you.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mitch S  
View profile  
 More options Jan 30 2012, 1:26 pm
From: Mitch S <mitchellsu...@gmail.com>
Date: Mon, 30 Jan 2012 10:26:31 -0800
Local: Mon, Jan 30 2012 1:26 pm
Subject: Re: [ODK Community] How to Access Photos from MySQL Database?

The easiest way to access the images is through the ODK Aggregate URL for
accessing attachments.

The database tables are structured so that unbounded-size images can be
stored in the database.  If your image size is under 1 MB, it is stored in
one data record, but if you have larger image files (or longer streaming
videos), they are split across multiple blob records, and writing the logic
to reconstruct them will be error-prone.

The ODK Aggregate URL for, e.g., the GeoTagger form on
opendatakit.appspot.com, looks like:

http://opendatakit.appspot.com/view/binaryData?blobKey=geo_tagger_v2%...

If you want a small thumbnail, specify previewImage=true (as above).
If you want to download it as an attachment (or access the original
filename), you can also specify as_attachment=true, in which case it will
supply the filename as originally uploaded.

The blobKey identifies the image.  As with all URLs, the parameters are
URLEncoded which makes them very ugly.  The URLDecoded blobKey looks like:

geo_tagger_v2[@version=null and
@uiVersion=null]/geotagger[@key=uuid:f6454ba6-2485-426f-8e1a-8981e463e6fe]/ Image

This is an XPath-style naming for the image element in the Xform.  It
identifies the form id: get_tagger_v2, the version and uiVersion values
(from the attributes on the Xform's top-level element), the name of the
top-level element in the form (geotagger), the primary key for the
submission being referenced (uuid:f6454ba6-2485-426f-8e1a-8981e463e6fe) and
the XPath within the form to the image.  In this case, the image (field
name Image) is immediately underneath the top-level element in the form.
If you had repeat groups, you would have to specify the ordinal (1..n) of
the repeat group.  So for the first repeat group, you would have:

.../repeatElement[@ordinal=1]/Image

and for the 5th repeat, you would specify:

.../repeatElement[@ordinal=5]/Image

Mitch

On Mon, Jan 30, 2012 at 9:24 AM, Feltpad Incorporated
<feltpad...@gmail.com>wrote:

> We have installed ODK Aggregate and we are using a MySQL Database.

> I can see the data inside the _PHOTO_BIN, _PHOTO_BN, and PHOTO_REF
> tables - but how do I read this data and display the image? I see in
> the _PHOTO_BN table there is a field named UNROOTED_FILE_PATH which
> contains a .jpg filename, but I don't know if this can actually be
> used to access the image?

> Thank you.

> --
> Post: opendatakit@googlegroups.com
> Unsubscribe: opendatakit+unsubscribe@googlegroups.com
> Options: http://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsu...@gmail.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
W. Brunette  
View profile  
 More options Jan 30 2012, 2:22 pm
From: "W. Brunette" <wbrune...@gmail.com>
Date: Mon, 30 Jan 2012 11:22:33 -0800
Local: Mon, Jan 30 2012 2:22 pm
Subject: Re: [ODK Community] How to Access Photos from MySQL Database?
Another way (perhaps easier) to access the files on a harddrive is to
use the ODK Briefcase tool to download your forms into Briefcase's
directory structure. In the process Briefcase will construct the
binary data back into a JPG and you can copy the pictures you want out
of the directory.

Waylon


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Feltpad Incorporated  
View profile  
 More options Jan 31 2012, 10:44 am
From: Feltpad Incorporated <feltpad...@gmail.com>
Date: Tue, 31 Jan 2012 07:44:55 -0800 (PST)
Local: Tues, Jan 31 2012 10:44 am
Subject: Re: How to Access Photos from MySQL Database?
When I create my URL and try it in my browser, it asks me to log into
Aggregate. We are attempting to create an interface for our users, so
they do not need to login to Aggregate.

Is there a way to do this so users don't have to login to Aggregate?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yaw Anokwa  
View profile  
 More options Jan 31 2012, 12:08 pm
From: Yaw Anokwa <yano...@gmail.com>
Date: Tue, 31 Jan 2012 09:08:32 -0800
Local: Tues, Jan 31 2012 12:08 pm
Subject: Re: [ODK Community] Re: How to Access Photos from MySQL Database?
You can stream the data to Google Fusion Tables or Spreadsheets and
visualize it there (and embed it in a website). If it's static data
you can also export a KML they can use in Google Maps or Google Earth.

On Tue, Jan 31, 2012 at 07:44, Feltpad Incorporated


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mitch S  
View profile  
 More options Jan 31 2012, 1:18 pm
From: Mitch S <mitchellsu...@gmail.com>
Date: Tue, 31 Jan 2012 10:18:08 -0800
Local: Tues, Jan 31 2012 1:18 pm
Subject: Re: [ODK Community] Re: How to Access Photos from MySQL Database?

Yaw's suggestion doesn't work because the images are still hosted off the
Aggregate website.  However, there is a solution:

Under the Site Admin tab, on the Permissions sub-tab, beneath the Edit
Users table of users and above the Save Changes button, there is a checkbox
for:

*Allow anonymous retrieval of images, audio and video data (needed for
GoogleEarth balloon displays)**
*
Check that checkbox, and save the permissions changes.  This will allow
anonymous access to all attachments.  Given that you need to know the
instanceID for the data being retrieved, it is reasonably secure to make
this change.

I'm working on OAuth2 support in Aggregate which would provide an entirely
secure way to access the images.

Mitch

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsu...@gmail.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
W. Brunette  
View profile  
 More options Jan 31 2012, 2:10 pm
From: "W. Brunette" <wbrune...@gmail.com>
Date: Tue, 31 Jan 2012 11:10:57 -0800
Local: Tues, Jan 31 2012 2:10 pm
Subject: Re: [ODK Community] Re: How to Access Photos from MySQL Database?
Mitch instructions about how to remove the security on the photos is
the solution I would suggest.

I wanted to reiterate that the Site Admin tab allows you to control
the permissions for Aggregate. You can setup Aggregate so it does not
ask for any login to do anything. It is all under your control.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
demo01.atomfo...@gmail.com  
View profile   Translate to Translated (View Original)
 More options Jun 27 2012, 10:24 am
From: demo01.atomfo...@gmail.com
Date: Wed, 27 Jun 2012 07:24:52 -0700 (PDT)
Local: Wed, Jun 27 2012 10:24 am
Subject: Re: [ODK Community] How to Access Photos from MySQL Database?

Is there any place in the code that determines this 1MB maximum size per blob? I am finding that even if I submit an image of 85KB, that this will be split into 2 blob parts. I am not sure if someone has 'tampered' with a setting somewhere which may be causing this.

Thanks.

Paul.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mitch S  
View profile  
 More options Jun 27 2012, 12:46 pm
From: Mitch S <mitchellsu...@gmail.com>
Date: Wed, 27 Jun 2012 09:46:50 -0700
Local: Wed, Jun 27 2012 12:46 pm
Subject: Re: [ODK Community] How to Access Photos from MySQL Database?

My bad.  When I create the table, I am erroneously using a "BLOB" which has
the 65k limit.  I had meant to change this to "LONGBLOB" after testing.

http://code.google.com/p/opendatakit/source/browse/src/main/java/org/...

The fix will be in the official ODK Aggregate 1.1 release.

If you need this now, you can stop the ODK Aggregate server, use a MySQL
database admin tool or the command prompt to issue a command on each
..._BLB table:

ALTER TABLE tablename MODIFY COLUMN `VALUE` longblob NOT NULL;

When ODK Aggregate restarts, since these columns are now defined as
LONGBLOBs, it will automatically adjust how it breaks up new submissions to
the table.  The existing data will not be affected and will have the
earlier 65KB chunk size.

Mitch

On Wed, Jun 27, 2012 at 7:24 AM, <demo01.atomfo...@gmail.com> wrote:
> Is there any place in the code that determines this 1MB maximum size per
> blob? I am finding that even if I submit an image of 85KB, that this will
> be split into 2 blob parts. I am not sure if someone has 'tampered' with a
> setting somewhere which may be causing this.

> Thanks.

> Paul.

> --
> Post: opendatakit@googlegroups.com
> Unsubscribe: opendatakit+unsubscribe@googlegroups.com
> Options: http://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsu...@gmail.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »