i used "exiftool -m -overwrite_original -tagsFromFile "$1" -all:all '-CopyrightNotice<Rights' cq5dam.thumbnail.500w.jpg" to overwrite the information from the original file from where rendition is created but it also overwrite the Image DPI information please help me to fix the same issue.
You can either replace -All:All with a more targeted approach, copying only the groups or specific tags you want
exiftool -m -overwrite_original -tagsFromFile "$1" -EXIF:all -IPTC:all -XMP:All -ColorSpaceTags '-CopyrightNotice<Rights' cq5dam.thumbnail.500w.jpg
Or you can add a second -TagsFromFile option (https://exiftool.org/exiftool_pod.html#tagsFromFile-SRCFILE-or-FMT) to copy the resolution tags back into the file. This has to be after the first -TagsFromFile because subsequent assignments to the same tag will overwrite previous assignments
exiftool -m -overwrite_original -tagsFromFile "$1" -all:all '-CopyrightNotice<Rights' -TagsFromFile @ -XResolution -YResolution -ResolutionUnit cq5dam.thumbnail.500w.jpg
The second approach might require you to figure out where your resolution tags are located in the first place (use FAQ #3 (https://exiftool.org/faq.html#Q3)) because resolution tags can be held in the EXIF group, the JFIF group, the Photoshop group (more complicated to copy), or possibly other groups. Resolution tags can appear in a lot of places and different programs will read the data from different places.