Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As a moderator, I want existing uploaded images migrated to wagtail so that I can manage them in the new system. #248

Closed
4 tasks done
thatbudakguy opened this issue Dec 8, 2020 · 7 comments
Assignees
Milestone

Comments

@thatbudakguy
Copy link
Contributor

thatbudakguy commented Dec 8, 2020

testing notes

  • In the wagtail editor/admin interface, you should see an "images" option in the left navigation. You should be able to:
    • browse wagtail images generated from the uploaded images in the old mezzanine media browser
    • search images by filename (partial match works)
    • browse subsets of images by collection (collections should have been created based on top-level folder in the old media browser)
    • edit an existing image
  • Landing Pages should have the correct header image set as a wagtail image; check by editing a landing page and looking at the associated header image and trying to edit it.
  • It might be useful to compare the images with the content of the mezzanine media browser to check the migrated images.
  • Not strictly part of this, but it would probably be useful to test uploading a new image.

dev notes

  • convert images from mezzanine's image/media class to wagtail's Image
  • figure out how to rewrite rule for image redirects from old location to new
  • report on images with duplicate names but different contents
  • use wagtail to resize images for thumbnails (event card, person card; project?)
  • update LandingPage banner image foreign key to use exodized wagtail image
@thatbudakguy thatbudakguy added this to the v3.0 milestone Dec 8, 2020
@thatbudakguy thatbudakguy changed the title As a content editor, I want uploaded images migrated to wagtail so that I can manage existing images in the new system. As a content editor, I want existing uploaded images migrated to wagtail so that I can manage them in the new system. Dec 8, 2020
@rlskoeser rlskoeser self-assigned this Dec 18, 2020
@rlskoeser
Copy link
Contributor

A handful of images exist with the same name in different locations and different contents. Here's a quick report to confirm they are all variations of the same image (which seems to be the case).

las416_hum416-syllabus1.jpg
las416_hum416-syllabus1.jpg
las416_hum416-syllabus1.jpg

tang_detail.png
tang_detail.png
tang_detail.png

headshot_kulkarni_new.jpg
headshot_kulkarni_new.jpg
headshot_kulkarni_new.jpg
headshot_kulkarni_new.jpg

staedteatlas-schlesien_gebaeudeansichten_en.jpg
staedteatlas-schlesien_gebaeudeansichten_en.jpg
staedteatlas-schlesien_gebaeudeansichten_en.jpg

3de86979-08a3-4f3d-8ad8-f71618da03aa.jpeg
3de86979-08a3-4f3d-8ad8-f71618da03aa.jpeg
3de86979-08a3-4f3d-8ad8-f71618da03aa.jpeg

center_for_digital_humanities_bio_pic_(1).jpg
center_for_digital_humanities_bio_pic_(1).jpg
center_for_digital_humanities_bio_pic_(1).jpg

sean-fraga-princeton-profile.jpg
sean-fraga-princeton-profile.jpg
sean-fraga-princeton-profile.jpg

image_from_ios.jpg
image_from_ios.jpg
image_from_ios.jpg

archive.jpeg
archive.jpeg
archive.jpeg

pdh_building_an_audience_poster2.jpg
pdh_building_an_audience_poster2.jpg
pdh_building_an_audience_poster2.jpg

nnavigator-logo-cropped.jpg
nnavigator-logo-cropped.jpg
nnavigator-logo-cropped.jpg

marisa.jpeg
marisa.jpeg
marisa.jpeg

@rlskoeser
Copy link
Contributor

I think the apache rewrite rule we want should be something like this:

RewriteEngine On
RewriteCond "%{REQUEST_URI}"  "^/media/uploads" 
RewriteRule "/(.*\.(jpg|jpeg|gif|png))$" "/media/original_images/$1" [L,R=301]

It's not working in an online regex tester but I'm not sure why, and this is pretty close to some of the examples in the apache documentation, so hopefully it will work with a little testing and tweaking.

@thatbudakguy how/where should we track adding this to our deploy apache conf? We can't add it yet or because will break cdhweb 2.8.1.

@thatbudakguy
Copy link
Contributor Author

make a chore in this repo in 3.0 milestone so it doesn't get forgotten, if you're OK with that

@rlskoeser
Copy link
Contributor

@thatbudakguy I think this is done, since the two remaining items on the check list are documented elsewhere:

  • using wagtail to resize images is covered by revisit image sizing guidelines #266
  • associating images with pages that have FKs needs to be done when we exodize those models; I handled the landing pages, which gives us a model for how to do the others

@cvansant
Copy link

Supposedly, one is supposed to see the "latest images" first, but this definitely doesn't work. The first page shows really old stuff that I can't even identify. This is true under the categories, too. Perhaps the "latest images" are just the ones that transferred from mezzanine most recently? However, when I added a new image, it did come up first as expected.

You probably know this, but the more recent images from the blog aren't there.

On the test site, the images that aren't in a folder on Mezzanine are in a collection called "root." [I am responsible for not putting images into folders on Mezzanine...Should I do that?]

I successfully uploaded an image!

@rlskoeser
Copy link
Contributor

@cvansant I think the "latest images" sorting won't work on migrated content because they're all created at nearly the same time by the exodus script. It should work on newly uploaded content, as you see.

We're probably testing on a media snapshot from December, which would explain the recent blog images that we're missing. We'll want to test migrating everything at some point, but not sure it matters for this.

The "root" collection is just the wagtail default for the top-level collection. There are lots of images not in folders in mezzanine, certainly not just you! We never established a convention for this. If you upload an image from a particular part of the site, it should be preset to put it in a particular folder to start, but we've never really enforced that. Maybe when we charter the next phase of cdhweb we could think about whether we want to establish workflows or best practices for using collections for images etc.?

Glad to hear you were able to upload a new image!

Did you check the landing page header images?

@cvansant with these explanations (about latest image sorting & missing recent content), does this pass testing?

@cvansant
Copy link

@rlskoeser Yes!

@thatbudakguy thatbudakguy changed the title As a content editor, I want existing uploaded images migrated to wagtail so that I can manage them in the new system. As an editor, I want existing uploaded images migrated to wagtail so that I can manage them in the new system. Feb 16, 2021
@thatbudakguy thatbudakguy changed the title As an editor, I want existing uploaded images migrated to wagtail so that I can manage them in the new system. As a moderator, I want existing uploaded images migrated to wagtail so that I can manage them in the new system. Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants