Lost title after reindexed #271

Closed
opened 2026-02-19 23:05:22 -05:00 by deekerman · 7 comments
Owner

Originally created by @tam-wh on GitHub (May 22, 2020).

Originally assigned to: @lastzero on GitHub.

The first time i indexed my photos, it puts the location name into keywords and also using the location name for the title.

After re-indexed, the location name is now removed from the keywords and the title. If there were no labels on the photo, the title will become "Unknown"

2020-05-22 10:41:52 INFO photo: changed photo title to “Unknown / 2019”
Originally created by @tam-wh on GitHub (May 22, 2020). Originally assigned to: @lastzero on GitHub. The first time i indexed my photos, it puts the location name into keywords and also using the location name for the title. After re-indexed, the location name is now removed from the keywords and the title. If there were no labels on the photo, the title will become "Unknown" ``` 2020-05-22 10:41:52 INFO photo: changed photo title to “Unknown / 2019” ```
deekerman 2026-02-19 23:05:22 -05:00
Author
Owner

@lastzero commented on GitHub (May 22, 2020):

Did you originally import your photos? We don't extract keywords from original names after indexing the first time so that users can remove them if needed. They would otherwise come back every time you index.

In addition, we moved some fields so that users can now enjoy descriptions in the card view and photo viewer. So the data is still there, but in the wrong table. Automatic migrations can't fix this. It's some manual work to recover it if your really need to.

However, it would be best to start with a fresh database once we have a stable release that we can provide smoother upgrades for. See #319.

Please always have a backup when testing our development version or do so in read only mode :)

@lastzero commented on GitHub (May 22, 2020): Did you originally import your photos? We don't extract keywords from original names after indexing the first time so that users can remove them if needed. They would otherwise come back every time you index. In addition, we moved some fields so that users can now enjoy descriptions in the card view and photo viewer. So the data is still there, but in the wrong table. Automatic migrations can't fix this. It's some manual work to recover it if your really need to. However, it would be best to start with a fresh database once we have a stable release that we can provide smoother upgrades for. See #319. Please always have a backup when testing our development version or do so in read only mode :)
Author
Owner

@tam-wh commented on GitHub (May 22, 2020):

No, I use photoprism in read only mode. The location name as in streets/country name extracted from gps information. Here's how to reproduce the issue (I have reset all database and config files)

  1. Index an existing folder
2020-05-22 14:04:02 INFO photo: new title is “Airport / Spain / 2018”
2020-05-22 14:04:02 INFO photo: using label Airport to create photo title
2020-05-22 14:03:59 INFO index: added main raw file 

Property of one of the image

Title : Airport / Spain / 2018
Keywords: airport, brown, building, catalonia, el-prat-de-llobregat, spain

  1. Reindex the same folder with "Complete Rescan" checked
2020-05-22 14:08:27 INFO photo: changed photo title to “Building / 2018”

Property of the same image

Title : Building / 2018
Keywords: airport, brown, building

@tam-wh commented on GitHub (May 22, 2020): No, I use photoprism in read only mode. The location name as in streets/country name extracted from gps information. Here's how to reproduce the issue (I have reset all database and config files) 1) Index an existing folder ``` 2020-05-22 14:04:02 INFO photo: new title is “Airport / Spain / 2018” 2020-05-22 14:04:02 INFO photo: using label Airport to create photo title 2020-05-22 14:03:59 INFO index: added main raw file ``` Property of one of the image > Title : Airport / Spain / 2018 > Keywords: airport, brown, building, catalonia, el-prat-de-llobregat, spain 2) Reindex the same folder with "Complete Rescan" checked ``` 2020-05-22 14:08:27 INFO photo: changed photo title to “Building / 2018” ``` Property of the same image > Title : Building / 2018 > Keywords: airport, brown, building
Author
Owner

@lastzero commented on GitHub (May 22, 2020):

In this case I'm sorry not to have a quick answer. If you don't find the solution in the meantime, I'll debug it with you as soon as I'm done with albums.

@lastzero commented on GitHub (May 22, 2020): In this case I'm sorry not to have a quick answer. If you don't find the solution in the meantime, I'll debug it with you as soon as I'm done with albums.
Author
Owner

@tam-wh commented on GitHub (May 22, 2020):

I believe it has to be this code. Since if the photo is reindexed, the photo will already contains a title hence photo.NoTitle() will return false and photo.UpdateLocation will not run.

if photo.NoTitle() {
			if photo.HasLatLng() {
				var locLabels classify.Labels
				locKeywords, locLabels = photo.UpdateLocation(ind.conf.GeoCodingApi())
				labels = append(labels, locLabels...)
			} else {
				log.Debugf("index: no coordinates in metadata for %s", txt.Quote(m.RelativeName(ind.originalsPath())))

				photo.Place = &entity.UnknownPlace
				photo.PlaceID = entity.UnknownPlace.ID
			}
		}
@tam-wh commented on GitHub (May 22, 2020): I believe it has to be this code. Since if the photo is reindexed, the photo will already contains a title hence photo.NoTitle() will return false and photo.UpdateLocation will not run. ``` if photo.NoTitle() { if photo.HasLatLng() { var locLabels classify.Labels locKeywords, locLabels = photo.UpdateLocation(ind.conf.GeoCodingApi()) labels = append(labels, locLabels...) } else { log.Debugf("index: no coordinates in metadata for %s", txt.Quote(m.RelativeName(ind.originalsPath()))) photo.Place = &entity.UnknownPlace photo.PlaceID = entity.UnknownPlace.ID } } ```
Author
Owner

@lastzero commented on GitHub (May 22, 2020):

Think I can see the same on the demo, going to fix it ASAP.

@lastzero commented on GitHub (May 22, 2020): Think I can see the same on the demo, going to fix it ASAP.
Author
Owner

@tam-wh commented on GitHub (May 22, 2020):

thanks! I was in the process of forking, making some changes and rebuilding the docker image for testing :) Probably faster on your end since building the docker images took forever

@tam-wh commented on GitHub (May 22, 2020): thanks! I was in the process of forking, making some changes and rebuilding the docker image for testing :) Probably faster on your end since building the docker images took forever
Author
Owner

@tam-wh commented on GitHub (May 23, 2020):

Tested latest docker image and this bug is now fixed. thanks!

@tam-wh commented on GitHub (May 23, 2020): Tested latest docker image and this bug is now fixed. thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/photoprism#271
No description provided.