BUG 1: Multiple Images with one Item in Pawtucket.
I am still having a problem with the proper display of multiple images attached to one item. In Providence, there does not seem to be any problem (aside from BUG 2, which I will post later), but in Pawtucket, whenever an item has more than one representation attached to it, one of these images will not show. All will show up as thumbnails, but when I go through the files using the arrows, one will just give a blank space. This is not an issue with the individual files. If I make the file that does not display the primary representation, another file will not show. Also, if I make the non-displaying file the primary representation and I only refresh the Pawtucket page, all files will show. The problem only appears again when I leave the page completely and come back to it later.
A possible clue is the HTML code of the page for the case of two images. The code for the jcarousel seems to only take one of the files into account:
<div class="jcarousel" id="repViewerCarousel">
<ul>
# First element of the carousel
<li id='slide64' class='64'><div id='slideContent64'><div data-representation_id='64' class='repViewerContCont'><div id='cont64' class='repViewerCont'><div><a href='#' class='zoomButton' onclick='caMediaPanel.showPanel("/Catalog/index.php/Detail/GetMediaOverlay/context/objects/id/784/representation_id/64/overlay/1"); return false;'><img src='https://www.theoldtownmuseum.org/Catalog/media/collectiveaccess/images/0/51461_ca_object_representations_media_64_large.jpg' id='caMediaOverlayTileViewer_64_detail' width='700' height='641' alt='Small basket with lid' /></a></div> <div class='detailMediaToolbar'><a href='#' class='zoomButton' onclick='caMediaPanel.showPanel("/Catalog/index.php/Detail/GetMediaOverlay/context/objects/id/784/representation_id/64/set_id/0/overlay/1", function() { var url = jQuery("#" + caMediaPanel.getPanelID()).data("reloadUrl"); if(url) { window.location = url; } }); return false;' aria-label='Zoom'><span class='glyphicon glyphicon-zoom-in' role='button' aria-label='Zoom'></span></a> <a href='#' class='setsButton' onclick='caMediaPanel.showPanel("/Catalog/index.php/Lightbox/addItemForm/context/objects/object_id/784"); return false;' aria-label='Login to add to lightbox'><i class='fa fa-folder' aria-label='Add'></i></a></div><!-- end detailMediaToolbar --><div class="small">Small basket with lid</div></div></div></div></li>
# Second element of the carousel with empty div boxes.
<li id='slide65' class='65'><div id='slideContent65'></div></li>
</ul>
</div><!-- end jcarousel -->
So, what is going on here?
Thanks,
Eisso
Comments
Please submit any bugs to GitHub, sounds like an off by one error in iterating an array/list
The missing content in the div is because the carousel is dynamic and jQuery will fill it in on load.
I have a user I believe reporting the very same issue. The problem is that I can't replicate it and the user eventually had it go away and it loads fine. But it sounded like the same problem.
Are you having consistent behaviour or does it come and go?
I think it is consistent behavior, although I cannot say for sure. I am pretty sure that once multiple images have been attached to an object, the way these images display does not vary between views of that object's page in Pawtucket. What I do not know for sure is that attaching multiple images to an object will always result in the reported behavior. I played around with a few dummy objects with up to five images and got the reported behavior every time. As far as I can tell, as long as the last image in the list as displayed in Providence is not the primary representation, it will be this last image that is not displayed. Also, it is not only the image that is not displayed. The caption is not displayed either.
I currently have three objects with multiple representations and all three show the same behavior. The confusing part is that everything works fine under certain conditions that are not under the user's control. For instance, if I go to a (Pawtucket) page for an object with multiple images, it will have the reported behavior. However, if I change the primary representation in Providence to the missing (final) image, and then only refresh the Pawtucket page, everything works as intended as long as I do not leave the page. As soon as I leave the page and return to it, the reported behavior is back (with the difference that the image that was originally missing is now displayed and the penultimate image as listed in Providence is now missing). I have a feeling there might be more situations like that, as I thought a number of times that I had fixed the problem only to find out that I really had not.
I have not really fiddled with the image settings, except that I put in a watermark for large images in media_processing.conf:
ca_object_representations = {
.................
MEDIA_TRANSFORMATION_RULES = {
...................
rule_large_image = {
SCALE = {
width = 700, mode = width, antialiasing = 0.5
},
WATERMARK = {
image = (path removed)
width = 80, height = 78, position = south_east, opacity = 1
},
SET = {quality = 75, format = image/jpeg, background = "#ffffff" }
},
....................
}
}
I can see if removing the watermark makes a difference, but I am a bit strapped for time right now. As an aside, I would like to know to what extent I can thin out media_processing.conf in my app/conf/local folder. Can I just put in the above without the dots and the comma preceding the last set of dots and will Providence get the rest from the default file? Could I perhaps even leave off the SCALE and SET part? I have not had time yet to experiment with that. For now, with every update, I just copy the default media_processing.conf and then make the one change. Maybe something went wrong there (as in keeping an old version of the file or who knows what). Would using an old media_processing.conf (version1.7.*) make a difference? I doubt it, but I can double-check that too.
Anyway, you can see the behavior of my three objects with multiple representations by going to https://theoldtownmuseum.org/Catalog. Once you get there, search for baskets or click on any basket in the gallery. With one exception, all baskets have multiple images.
Thanks,
Eisso
See my previous post. I had some time to check if the watermarking might be the problem, but, no, it does not make any difference. I also checked my local media_processing.conf and except for the watermark part, it is identical to the default media_processing.conf, which according to what I see on GitHub has not changed in two years. So, still no clue on what is going on here.
BTW, it does appear that setting up watermarking through a local file does require the full ca_object_representation array of arrays, i.e the content that I represented with the dotted lines in my previous post cannot be left out. Is there any other (shorter) way? Basically, it seems there should be a way to insert the watermark part into the full array rather than replacing that array. I also imagine that inserting is a lot slower than just replacing the array.
Eisso
To Jeff,
I went back to my multiple images after not having looked at them for about 3 weeks and now the display seems to behave as it is supposed to. However, when I add a new record with multiple images, I see the same behavior described in this thread again. For the other records, everything remains fine. So, apparently this behavior is definitely there, but does go away after a while. Notice that Monica could replicate this behavior on the collective access server too, albeit not consistently.
Could this issue have to do with caching? Other than setting my caching backend to sqlite for both Providence and Pawtucket, I have not changed any caching setting. I will check what happens if I add an image to a record which has long had a representation attached to it....
Eisso
I was able to replicate the issue with the last image not showing in the carousel. It came up apparently randomly after working fine and then goes away. Instead of taking time to debug, I just replaced it with a new plugin carousel with a lightbox.
But to address your issue, yes I also had some funny things going on and I reckon there's a bug, so good you created a github issue.