Title: Meta data corrupts easily
Last modified: August 21, 2016

---

# Meta data corrupts easily

 *  Resolved [Stephen S](https://wordpress.org/support/users/ssuess/)
 * (@ssuess)
 * [12 years ago](https://wordpress.org/support/topic/meta-data-corrupts-easily/)
 * Every since “upgrading” a bunch of old sites that were running 1.9.1, I have 
   noticed a ton of problems with corrupt meta-data. I run a direct query on the
   db where I need to get height and width values from the meta_data field in wp_ngg_pictures,
   and this is almost impossible now because any save of a gallery corrupts this
   field. I can get meta data back temporarily by selecting all my images and using“
   import metadata” from the drop-down, but as soon as ANY change or save is made
   to the gallery, they are corrupt again. This is happening across 3 of my sites
   hosted in various places. Does anyone know of a fix?
 * [https://wordpress.org/plugins/nextgen-gallery/](https://wordpress.org/plugins/nextgen-gallery/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [12 years ago](https://wordpress.org/support/topic/meta-data-corrupts-easily/#post-4990962)
 * [@stephen](https://wordpress.org/support/users/stephen/) S – The current versions
   of NextGEN Gallery save the image meta data as base64, if you decode that information
   you will find all of the meta details.
 * Also to note, NextGEN Legacy versions (pre-2.0.x) did not use base64 encoding
   of the meta data so it would appear more like “plain text” and will continue 
   to do so until the meta data is edited and/or re-saved.
 * – Cais.
 *  Thread Starter [Stephen S](https://wordpress.org/support/users/ssuess/)
 * (@ssuess)
 * [12 years ago](https://wordpress.org/support/topic/meta-data-corrupts-easily/#post-4990964)
 * Well, that is somewhat of a help, thanks, except that the data (no matter how
   many times I re-save it) seemed to be serialized incorrectly. When I try the 
   following:
 *     ```
       while($row = $rs->fetch_assoc()){
       $variables = unserialize(base64_decode($row["meta_data"]));
       $wid = $variables["width"];
       echo $wid;
       }
       ```
   
 * It will not return width values, AND it gives me a PHP notice about an Error 
   at offset 0, which usually indicates badly serialized data.
 * Any ideas?
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [12 years ago](https://wordpress.org/support/topic/meta-data-corrupts-easily/#post-4990965)
 * [@stephen](https://wordpress.org/support/users/stephen/) S – At the moment, no…
   but this topic has been flagged into another issue one of our developers has 
   been trying to work on. I’ll add another note for them to have a look at this
   when they have the opportunity.
 * – Cais.
 *  Thread Starter [Stephen S](https://wordpress.org/support/users/ssuess/)
 * (@ssuess)
 * [12 years ago](https://wordpress.org/support/topic/meta-data-corrupts-easily/#post-4990968)
 * So there is no workaround to get the original width directly from the db? I need
   to downgrade to 1.9.1?
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [12 years ago](https://wordpress.org/support/topic/meta-data-corrupts-easily/#post-4990969)
 * [@stephen](https://wordpress.org/support/users/stephen/) S – I’ve asked one of
   our developers to look into this as part of another issue they are looking at
   regarding meta data as they believe it may be related.
 * With that I have specifically ask they review this topic to address your question,
   I do not have an answer at this time on how best to get to the details you are
   looking for; and, we do *not* recommend rolling back to NextGEN Legacy versions(
   pre-2.0.x).
 * – Cais.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Meta data corrupts easily’ is closed to new replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

## Tags

 * [Corruption](https://wordpress.org/support/topic-tag/corruption/)
 * [meta-data](https://wordpress.org/support/topic-tag/meta-data/)

 * 5 replies
 * 2 participants
 * Last reply from: [photocrati](https://wordpress.org/support/users/photocrati/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/meta-data-corrupts-easily/#post-4990969)
 * Status: resolved