Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 11. Dec 2018, 13:53

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 23. Oct 2014, 04:32 
Offline
User avatar

Joined: 17. Oct 2014, 18:58
Posts: 7
Hello,

When I put unicode XMP keyword (embedded in photo) in other languages, eg. Thai language, it will not show under Info->Image Tags, and will not be searchable. To my understanding TWG uses function utf8_encode and that ignores all symbols and characters from other languages.

I went ahead and did a temporary hack that fixes the issue. Hopefully this can be refined by TWG and to allow unicode tags into next release.

Best Regards,
Pumin

inc/readxml.inc.php

line# 1328 change
Code:
//$retArray["image"] = ($iptc_encoding == 'utf-8') ? $retArray["image"] : utf8_encode($retArray["image"]);
$retArray["image"] = ($iptc_encoding == 'utf-8') ? $retArray["image"] : myUrlEncode($retArray["image"]);


line# 1457
Code:
//$xml_string = "<BILD><NAME>" . urlencode($image) . "</NAME><WERT>" . UrlEncode($tags_image) . "</WERT></BILD>\n";
$xml_string = "<BILD><NAME>" . urlencode($image) . "</NAME><WERT>" . $tags_image . "</WERT></BILD>\n";


Code:
function myUrlEncode($string) {
// credit to davis.peixoto
$entities = array('%21', '%2A', '%27', '%28', '%29', '%3B', '%3A', '%40', '%26', '%3D', '%2B', '%24', '%2C', '%2F', '%3F', '%25', '%23', '%5B', '%5D');
$replacements = array('!', '*', "'", "(", ")", ";", ":", "@", "&", "=", "+", "$", ",", "/", "?", "%", "#", "[", "]");
return str_replace($entities, $replacements, $string);
}


Top
 Profile  
 
PostPosted: 23. Oct 2014, 09:26 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10950
Does setting
$iptc_encoding = 'utf-8';

in the config not simply solve you problem?

Best, Michael


Top
 Profile  
 
PostPosted: 28. Oct 2014, 14:40 
Offline
User avatar

Joined: 17. Oct 2014, 18:58
Posts: 7
Please disregard the hack.

Now TWG works normal without hack, and with both $iptc_encoding = ''; and = 'utf-8';

Not sure what I did to my server, TWG just works great! :roll:

Thanks Mike!


Top
 Profile  
 
PostPosted: 28. Oct 2014, 14:53 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10950
;). Feel free to recommend it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
powered by phpbb | Datenschutz/ Privacy policy