forum.coppermine-gallery.net

Support => Older/other versions => cpg1.3.x Support => Topic started by: GGallery on June 10, 2004, 10:51:43 pm

Title: [Solved]: JPEG pics with missing url path (img src="") after upgrade
Post by: GGallery on June 10, 2004, 10:51:43 pm
hmm I just upgraded from 1.2 to 1.3 - it looks great but for one user I am getting "empty pics"
http://gallery.greatestjournal.com/thumbnails.php?album=7931

(see the little squares)

the record in the picture table for e.g. picture #4 on the top and the files in userpics/ look OK:
mysql> select * from cpg11d_pictures where owner_id=148959 and filename like '%mreow%';
+------+------+------------------+------------+----------+----------------+--------+---------+------+----------------+------------+----------+---------------+------------+-------+-------------------------------------------+---------+----------+----------+-------+-------+-------+-------+------------+---------+--------------+--------------+
| pid  | aid  | filepath         | filename   | filesize | total_filesize | pwidth | pheight | hits | mtime          | ctime      | owner_id | owner_name    | pic_rating | votes | title                                     | caption | keywords | approved | user1 | user2 | user3 | user4 | url_prefix | randpos | pic_raw_ip   | pic_hdr_ip   |
+------+------+------------------+------------+----------+----------------+--------+---------+------+----------------+------------+----------+---------------+------------+-------+-------------------------------------------+---------+----------+----------+-------+-------+-------+-------+------------+---------+--------------+--------------+
| 7840 | 7931 | userpics/158959/ | mreow.jpeg |    91338 |         134433 |    640 |     480 |   16 | 20040610092039 | 1086790119 |   148959 | stealingtears |          0 |     0 | and this is also john. dont you want him? |         |          | YES      |       |       |       |       |          0 |      14 | 66.233.1.147 | 66.233.1.147 |
+------+------+------------------+------------+----------+----------------+--------+---------+------+----------------+------------+----------+---------------+------------+-------+-------------------------------------------+---------+----------+----------+-------+-------+-------+-------+------------+---------+--------------+--------------+

devel]# ll albums/userpics/158959/*mreow*
-rw-r--r--    1 nobody   nobody      91338 Jun  9 07:08 albums/userpics/158959/mreow.jpeg
-rw-r--r--    1 nobody   nobody      29966 Jun  9 07:08 albums/userpics/158959/normal_mreow.jpeg
-rw-r--r--    1 nobody   nobody      13129 Jun  9 07:08 albums/userpics/158959/thumb_mreow.jpeg

CPG delivers these empty pic because it's not putting the path into the img src=:
img src="" class="image" width="0" height="0"

but why? I looked at many more pics on our gallery but they all seem to be OK (and the pics in question were uploaded yesterday)
Title: Re: pics with missing url path (img src="") after upgrade
Post by: Joachim Müller on June 10, 2004, 11:07:35 pm
looks to me like you already heavily modified some files, especially the includes - I'm not sure what's wrong. I recommend setting up another cpg1.3.0 install that uses the same database table with unmodified files, just to be able to compare things and rule stuff out.

GauGau
Title: Re: pics with missing url path (img src="") after upgrade
Post by: GGallery on June 11, 2004, 12:35:17 am
it breaks on pics with extrension '.jpeg'

function get_pic_url(&$pic_row, $mode) returns '' ... I am not sure where exactly and why, either because of:
$thumb_extensions = Array('.gif','.png','.jpg');

or in the very last line in that function:
return $url_prefix[$pic_row['url_prefix']]. path2url($pic_row['filepath']. $pic_prefix[$mode]. $pic_row['filename']);


I actually upgraded to 1.3 without having any modifications done first and I got this effect right away on the .jpegs, then I added my (mostly theme/template related) patches

btw. love the: // Return the url for a picture, allows to have pictures spreaded over multiple servers
=> perfect to have the original pics somewhere on a slow IDE disk.
Title: Re: pics with missing url path (img src="") after upgrade
Post by: GGallery on June 11, 2004, 12:58:13 am
it took me a while:

insert into cpg130_filetypes values ('jpeg', 'image/jpeg', 'image');
(or whatever your $CONFIG['TABLE_FILETYPES'] says) 'fixes' the problem.
Title: Re: [Solved]: pics with missing url path (img src="") after upgrade
Post by: hyperion on June 11, 2004, 02:17:14 am
This MIME type seems to have been left out of the SQL files.

Users with tools like PHPMyAdmin may do this manually.

Otherwise, attached is a new update.sql file. Please note that it is currently named update.txt, so that it can be placed on this board.  You should change the file extension to .sql, which would make the file appear as update.sql on your webserver.

Users having this problem should replace the /sql/update.sql file with the one provided here.  Then the user should run the update.php file provided within CPG.  It is safe to run this file more than once.

[attachment deleted by admin]
Title: Re: [Solved]: JPEG pics with missing url path (img src="") after upgrade
Post by: Tarique Sani on June 11, 2004, 04:45:54 am
@Hyerion - Have you committed this to the CVS? 
Title: Re: [Solved]: JPEG pics with missing url path (img src="") after upgrade
Post by: hyperion on June 11, 2004, 05:42:42 am
Not at the time of your posting, but the sql CVS files have been updated as of now.
Title: Re: [Solved]: JPEG pics with missing url path (img src="") after upgrade
Post by: Tarique Sani on June 11, 2004, 06:41:50 am
@Hyerion - thanks