forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: jaus on September 27, 2013, 01:31:16 am

Title: Keyword field size limit
Post by: jaus on September 27, 2013, 01:31:16 am
I see that the keyword field in the  image database is 255 characters.   Can that be expanded?   I want to create a large gallery searchable by keywords and many of my images are having their keyword lists truncated because of the limit.
Title: Re: Keyword field size limit
Post by: Αndré on September 27, 2013, 09:38:28 pm
Sure. I currently have no option to look at the database, but you probably have to change the data type to something like TEXT, as we usually use VARCHAR, which supports only 255 characters. Additionally, you probably have to extend Coppermine's forms. Again, without code access I'm not quite sure. If you don't know your way around, let me know and I'll give more detailed instructions as soon as possible.
Title: Re: Keyword field size limit
Post by: jaus on September 28, 2013, 12:58:01 am
Thanks, I'll try just changing the keyword field to text with a length of about 400.

I have noticed however that, when I have keywords that exceed the 255 char limit, sometimes keywords are truncated at the beginning, and at the end of the list.   What would cause that?
Title: Re: Keyword field size limit
Post by: jaus on September 28, 2013, 01:07:00 am
Well I set the field type to TEXT, and the length values to 400 (although that field in phpmyadmin now reads blank), but I still get the same truncation of my keywords.

Perhaps there is code that limits ingested keywords to a total of 255 chars?
Title: Re: Keyword field size limit
Post by: Αndré on October 01, 2013, 04:21:21 pm
Have you adjusted any PHP code yet?
Title: Re: Keyword field size limit
Post by: jaus on October 01, 2013, 04:47:39 pm
I have not changed any code.
Title: Re: Keyword field size limit
Post by: Αndré on October 04, 2013, 10:06:40 am
Adjust the following values to your needs:
Quote from: edit_one_pic.php
<input type="text" style="width: 100%" name="keywords" maxlength="255" value="{$CURRENT_PIC['keywords']}" id="keywords" class="textinput" />
Quote from: editpics.php
array($icon_array['keyword'] . $keywordLabel, 'keywords', 0, 255),

I haven't found any limitations at the keyword manager. If I missed a form where you can change keywords, let me know.
Title: Re: Keyword field size limit
Post by: jaus on October 04, 2013, 07:30:52 pm
I also found this in upload.php:

Quote
            $form_array[] = array($keywordLabel, 'keywords', 0, 255, 1);

Would this cause the keywords in uploaded images to be truncated to 255 even if the database field was 400?
Title: Re: Keyword field size limit
Post by: Αndré on October 04, 2013, 08:19:30 pm
Correct.
Title: Re: Keyword field size limit
Post by: jaus on October 06, 2013, 03:24:41 pm
Expanding the KEYWORDS field in the PICUTURES table, and settting the keywords dimensions in the three lines quoted above to match the field width seems to have fixed the problem.

Thanks.