{{ $imagePathOld := printf "%s/%s" .root.BeforeRawPath (EscapePound .file.OldName) }}
{{ $imagePathNew := printf "%s/%s" .root.RawPath (EscapePound .file.Name) }}
<tr>
<th class="halfwidth center pl-3 pr-2">
{{.root.i18n.Tr "repo.diff.file_before"}}
</th>
<th class="halfwidth center pl-2 pr-3">
{{.root.i18n.Tr "repo.diff.file_after"}}
</tr>
<td class="halfwidth center pl-3 pr-2">
{{if or .file.IsDeleted (not .file.IsCreated)}}
<a href="{{$imagePathOld}}" target="_blank">
<img src="{{$imagePathOld}}" class="border red" />
</a>
{{end}}
</td>
<td class="halfwidth center pl-2 pr-3">
{{if or .file.IsCreated (not .file.IsDeleted)}}
<a href="{{$imagePathNew}}" target="_blank">
<img src="{{$imagePathNew}}" class="border green" />
{{ $imageInfoBase := (call .root.ImageInfoBase .file.OldName) }}
{{ $imageInfoHead := (call .root.ImageInfo .file.Name) }}
{{if or $imageInfoBase $imageInfoHead }}
{{if $imageInfoBase }}
{{ $classWidth := "" }}
{{ $classHeight := "" }}
{{ $classByteSize := "" }}
{{if $imageInfoHead}}
{{if not (eq $imageInfoBase.Width $imageInfoHead.Width)}}
{{ $classWidth = "red" }}
{{if not (eq $imageInfoBase.Height $imageInfoHead.Height)}}
{{ $classHeight = "red" }}
{{if not (eq $imageInfoBase.ByteSize $imageInfoHead.ByteSize)}}
{{ $classByteSize = "red" }}
{{.root.i18n.Tr "repo.diff.file_image_width"}}: <span class="text {{$classWidth}}">{{$imageInfoBase.Width}}</span>
|
{{.root.i18n.Tr "repo.diff.file_image_height"}}: <span class="text {{$classHeight}}">{{$imageInfoBase.Height}}</span>
{{.root.i18n.Tr "repo.diff.file_byte_size"}}: <span class="text {{$classByteSize}}">{{FileSize $imageInfoBase.ByteSize}}</span>
{{if $imageInfoHead }}
{{if $imageInfoBase}}
{{ $classWidth = "green" }}
{{ $classHeight = "green" }}
{{ $classByteSize = "green" }}
{{.root.i18n.Tr "repo.diff.file_image_width"}}: <span class="text {{$classWidth}}">{{$imageInfoHead.Width}}</span>
{{.root.i18n.Tr "repo.diff.file_image_height"}}: <span class="text {{$classHeight}}">{{$imageInfoHead.Height}}</span>
{{.root.i18n.Tr "repo.diff.file_byte_size"}}: <span class="text {{$classByteSize}}">{{FileSize $imageInfoHead.ByteSize}}</span>