file upload: Using the Exif

Discussion in 'Completed' started by Ajyamal, Mar 5, 2009.

  1. Ajyamal New Member

    Level: Community
    THe PHP has the powerful module that is called the Exif. I knew it possible to get a GPS infomation and a few other infomations from the Picture Data which has some sub info.The sub info is like a date, possioning info, file name....etc. When a picture being uploaded on the server, The server memorizes the sub info. Next, Fabrik get the sub info from the server.

    I am glad there are.
  2. Ajyamal New Member

    Level: Community
    For instance

    ### php code ###

    $exif = exif_read_data('sexy.jpg');

    foreach ($exif as $key=>$value)
    echo $key."=";
    echo "<hr>";
    ### EOF ###

    ### Excution Results ###


    ### EOF ###
  3. rob Administrator

    Level: Community
    I guess the issue is whether you need/want to store this info in the fabrik database or to simple read it from the image when you come to display it?
  4. Ajyamal New Member

    Level: Community
    HI rob , Thanks for looking into here

    I have an imagination llike ,

    1st - the sub data is stored in MYSQL via sort of the ' Elements ' of GGmap-plugin type, at the same time , the Picture data is stored in a file directly .
    2nd - when a Fabrik tabe view (or senir developers may customaize) is opend , it goes to display On a Fabrik table views, the photo and the sub data that like the GGmap viewer. Perhaps the externals is the thumbnail in this case. There are some idea for the viewer by the developer. I 'm glad that be added to Visualization or there might have been Templates.

    For developers, I can't imagin acually, Maybe it's similar with ' GGmap-plugin '. Or , 'file upload ' plus ' database join ' plus .

    Visualization for my explanation belows,
    (A) Photo
    0110101010101010101010110 -> Upload the file to a Directry ( Fabrik already have this function)

    (B) embeded infomation ( It isn't EXACLY )
    N .
    W. -> Pick it up only GPS infomations, send them to database and Then they are stored.

    Sorry I do not have checked out exactly what is the data strucure of the Exif. So it might have a little mess.
    This is my idea.

  5. Ajyamal New Member

    Level: Community
    My idea : The above-mentioned is supplemented.

    HI rob,

    There is the above-mentioned is supplemented.
    see the pdf file that is attached.


    Attached Files:

  6. cheesegrits Support Gopher

    Level: Community
    Rather than modifying the upload and googlemap elements, this might be relatively easy to do as a form submission plugin.

    My initial thoughts would be:

    Have a map element, set so 'normal' users only have read access.

    The plugin would just need an onBeforeStore() method, which reads the exif information from the uploaded file, and manually sets the lat/long info for the map element accordingly.

    It shouldn't be too hard. If you have some PHP experience, you should be able to do it youself. Choose one of the other existing form plugins which has an onBeforeStore method in it as a guide for how to do it.

    -- hugh
  7. cheesegrits Support Gopher

    Level: Community
    I got a wild hair and went ahead and built this as a form plugin. It's in the latest SVN, under ./com_fabrik/plugins/forms/fabrikexif.

    You'll have to ZIP it up and install it, as per the "how do i install plugins from SVN" thread in the 2.0 FAQ forum.

    The plugin settings require you to specify two fields (which you choose from dropdown menus), to tell it which element is the upload element, and which is the map element.

    When you upload an image which has EXIF geocoding data, it will extract the coords, and set the map element coords accordingly.

    NOTE - it currently only works for single uploads, i.e. it'll break if you try and use it with an upload field in a repeat group.

    -- hugh
  8. Ajyamal New Member

    Level: Community
    Hi cheesgrits,

    As if you guys is what a monster, unbelivable, being too much early. !!!
    And thank you so much about form-plugin. I immediately have used it.
    Then I've gotten a issue in the attempts, so that would like to ask you about a few Question.
    There is the explainations that is also about the test processes in the attachment.
    When you have some time, would you like to answer ?

    Indeed Thanks dear cheegezila and robzila

    Attached Files:

  9. cheesegrits Support Gopher

    Level: Community
    Ah, yes, I forgot to mention two things:

    You can't set the access on the element, as this means even the plugin can't modify the data. So you have to display the map as normal, with access set to whatever level the person filling out the form has.

    I had hoped it would be possible to hide the map when creating / editing the form, as the coords are going to be derived automatically, so there's no point allowing them to place a pin on the map.

    But right now I can't find a way of doing that (without cloning a template and hiding it manually).

    So ... try setting the access level back to the level of the person filling out the form.

    The second issue is, you can't specify a max width/height, because this means Fabrik will resize the image during the file upload processing. And unfortunately the process of resizing an image removes all the EXIF data from the file (which makes sense if you think about it, as most of it no longer applies to a re-processed version of the image). So try removing your max width/height in the Display options, leave them blank.

    If this is a problem, and you really need to resize the original image, I could try modifying the code slightly to use a different plugin location, and grab the EXIF information from the file before the upload code runs and does the resizing.

    Oh, one more thing - you'll need to update to latest SVN, as I had to make a small change to the fabrikfileupload plugin to allow this stuff to work.

    -- hugh
  10. Ajyamal New Member

    Level: Community
    I make sense that the answer here is be against either which is Question about icon (visible/nonvisible)
    - The element access Level does not matter in this issue.
    - I have to display the map as nomal on the table view.

    - I will try to reset the access level.

    - all right, I will try to remove the max size at first . It is also about the Tumbnail option.
    - Even if that is the isse, I am sorry that we can't use resize......

    - Cheer ! I can't do anything to say about this. IMPRESSED.
  11. Ajyamal New Member

    Level: Community
    Trial with Exif

    HI cheegegrits,

    The getting an lat/long to DB is concluded. Cheer !!!!!
    About the thumbnail looks like working.

    However I've gotten a issue.
    That is ' Detailed Link ' does not work on the both of Picture and Map.

    - table > Layout > Detailed view link = ON
    - elements > show in table = OFF
    - elements > Link to details = ON


    Attached Files:

  12. Ajyamal New Member

    Level: Community
    Viewing issue

    When I was doing following action on the Fabrik admin page. An error was ocurred.

    - Firebug resault
    phase1: Click on Tables tab -> show up the PIC1
    phase2: Click on view data tab -> show up the PIC2
    phase3: Click on the Tumbnail of picture or googlemap-> show up the PIC3

    - Fire Fox behaves
    phase1: looks fine.
    phase2: looks fine
    phase3: No coming up the detail. It keep doing white-out in the Firefox,
    when the Tumbnail (of picure or googlemap) was clicked on.
    *** First Time(click on), it's possible to shows up a Form view as detail.****
    J!1.5.9-Multilingual , XAMPP 1.7 , Fabric SVN1352 , Firefox/3.0.5 ,WindowsXP SP3

    Attached Files:

  13. cheesegrits Support Gopher

    Level: Community
    I can't duplicate this - my thumb links open into mediabox just fine (I use mediabox rather than slimbox).

    Those all seem to be warnings rather than errors. Try turning off "strict" in firebug, see what happens.

    We're aware that our JS will raise a lot of warnings if you have FB in 'strict checking' mode, where it runs the code thru a lint picker. But it's almost impossible to write JS that meets 'strict' standards (heck, mootools generates a zillion warnings).

    -- hugh
  14. Ajyamal New Member

    Level: Community
    hi, Thanks for giving good advices.

    Sorry I thogut that even if it was the warnning, it might be somthing relations. so that put on their error message, and then turned off ' java script warnning display ' !

    Now.. I have checked out the phperror logs, then gotten a few following error, So that it might be bad. I'm going to work on checking out these.
    Besides what Only I have failed a lot is only I have own particular Issue.
    So.. if you mind answering, could you tell me whether your system is XAMPP or NOT ?
    --- phperror-part1 ----------------
    [12-Mar-2009 01:39:31] PHP Fatal error: Unable to start eAccelerator module in Unknown on line 0

    --- phperror-part2 ----------------
    [12-Mar-2009 00:25:15] PHP Stack trace:

    [12-Mar-2009 00:25:15] PHP 1. {main}() I:\xampp\htdocs\159\administrator\index.php:0

    [12-Mar-2009 00:25:15] PHP 2. JAdministrator->dispatch() I:\xampp\htdocs\159\administrator\index.php:67

    [12-Mar-2009 00:25:15] PHP 3. JComponentHelper->renderComponent() I:\xampp\htdocs\159\administrator\includes\application.php:136

    [12-Mar-2009 00:25:15] PHP 4. require_once() I:\xampp\htdocs\159\libraries\joomla\application\component\helper.php:162

    [12-Mar-2009 00:25:15] PHP 5. JController->execute() I:\xampp\htdocs\159\administrator\components\com_fabrik\admin.fabrik.php:72

    [12-Mar-2009 00:25:15] PHP 6. FabrikControllerElement->save() I:\xampp\htdocs\159\libraries\joomla\application\component\controller.php:236

    [12-Mar-2009 00:25:15] PHP 7. FabrikModelElement->addToDBTable() I:\xampp\htdocs\159\administrator\components\com_fabrik\controllers\element.php:543

    [12-Mar-2009 00:25:15] PHP 8. FabrikModelTable->alterStructure() I:\xampp\htdocs\159\components\com_fabrik\models\element.php:1800

    [12-Mar-2009 00:25:15] PHP 9. FabrikModelFabrikDatabasejoin->getFieldDescription() I:\xampp\htdocs\159\components\com_fabrik\models\table.php:1893

  15. cheesegrits Support Gopher

    Level: Community
    I'm not currently testing on XAMPP, I'm using a Centos/Apache setup. But I do have a XAMPP install I could test on.

    I have no clue what the eAccelerator error is about, doesn't have anything to do with Fabrik.

    For the second part, the stack trace, there should be an actuall error/warning before the stack trace ... can you paste that for me?

    I don't think that error is anything to do with displaying the images, tho. Looks more like an issue when you are saving a change to an element on the backend.

    -- hugh
  16. Ajyamal New Member

    Level: Community
    Cheegegirts, I apriciate that things.

    I've attached log. See please.


    Attached Files:

  17. cheesegrits Support Gopher

    Level: Community
    It looks like you have some kind of bizarre problem in Joomla itself. The error log is full of errors like this:

    [08-Mar-2009 14:13:58] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'I:\xampp\htdocs\159\administrator\components\com_fabrik\controllers\1ANDUSER_NAMEdbo.php'

    ... where it's trying to open non-existant controller names. That's happening outside of Fabrik, somewhere in the J! code that decides which controller needs to be called for the URL being loaded.

    I'd suggest doing a J! update.

    -- hugh
  18. Ajyamal New Member

    Level: Community
    Thank you very much !

    I will update Joomla. And I have gotten lastest joomla1.5.9(rev11688 ) form joomla's SVN.
    May I overwire all joomla files without configuration.php ?
  19. cheesegrits Support Gopher

    Level: Community
  20. Ajyamal New Member

    Level: Community
    Thanks !

    Add a thing:

    When I click on tumbnail , come up a page(exif_cliclon_tumbnail.jpg). Next I click on the back button of firefox and submit sending button, come up a page(After_clickon_firefox_back_button_1.jpg), and then an error shows up (After_clickon_firefox_back_button_2.jpg )

    Attached Files:

Share This Page