google-code-export / candydolldb

Automatically exported from code.google.com/p/candydolldb
0 stars 0 forks source link

Cache Images not properly made for sets with 2 sets #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Import a set with 2 photo sets (so far only Yuliya K set 11 is only one)
2. Reload model set page to generate cache images
3. Cache image generated does not load, but everything else is fine (number of 
pics in the combined sets show properly)

What is the expected output? What do you see instead?
Expected output is a properly generate thumbnail. 
Instead you get a missing image, yet there is a row in the cacheimage table 
corresponding with the set_id, but no physical file is created. And with the 
addition of the improved clean up script in Admin Panel, it will show 1 missing 
file which is the cache image that should have been created.

I believe the problem lies in the fact that the cacheimage generation script 
tried to create a file, but doesn't know which of the 2 matching set folders to 
load the image from

Original issue reported on code.google.com by mranimos...@gmail.com on 25 Feb 2012 at 3:08

GoogleCodeExporter commented 9 years ago
also trying to view the images from within the Set view does not load the images

believe this is a naming failure, probably relating to the Regex used to get 
the filenames maybe. Currently my 2 Yuliya K set 11's are named set_11A and 
set_11B, so the  script fails cause it looks for set_11 and not one with A or B

Original comment by mranimos...@gmail.com on 25 Feb 2012 at 3:20

GoogleCodeExporter commented 9 years ago
Have reproduced the problem with my copies of YuliyaK11. It is indeed a naming 
issue, but not with the regex during import or the cache image handling.

Instead I have debugged it down to the Image->getFilenameOnDisk() function. It 
composes the filename from which to generate the cache image by sprintf-ing a 
few components:

CANDYIMAGEPATH,
$this->getSet()->getModel()->GetFullName(),
$this->getSet()->getPrefix(),
$this->getSet()->getName(), <== This is where it goes wrong.
$this->getFileName(),
$this->getFileExtension()

The set is named '11', so the function returns /set_11/YuliyaK11_199.jpg, and 
not /set_11A or /set_11B. It has no way of knowing about A or B... Not in this 
way of constructing a filename.

Now, if we would search the actual filesystem in this function, we might be 
successful in finding the 11A and 11B. But I think this would bring significant 
performance issues.

For now, I would recommend merging your A and B folders into one, named set_11. 
We then can put in the docs that such 'duplicate' folders are not supported.

I'll check in a fix for the error that seemed to follow on this issue: 
seemingly uncreatable cache images. The OutputImage function did not catch 
non-existing files on disk.

I would say: issue resolved. Agreed?

FWieP

Original comment by fwp...@gmail.com on 25 Feb 2012 at 6:28

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r330.

Original comment by fwp...@gmail.com on 25 Feb 2012 at 6:30

GoogleCodeExporter commented 9 years ago
agreed

Original comment by mranimos...@gmail.com on 25 Feb 2012 at 6:56