prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Use Full URL for ImageRenditionField.
  ### Is your proposal related to a problem?
  
  <!--
    Provide a clear and concise description of what the problem is.
    For example, "I'm always frustrated when..."
  -->
  
  I'm a big fan of the new `full_url` field that images have and would like them to be easily used in the API.
  
  Assuming one's frontend app is living on a different domain to the Wagtail API then the default relative URLs aren't as useful.
  
  ### Describe the solution you'd like
  
  <!--
    Provide a clear and concise description of what you want to happen.
  -->
  
  Add `full_url` to the output of `ImageRenditionField`.
  
  I propose it just replace the `url` field altogether, but both could be returned.
  
  ### Describe alternatives you've considered
  
  <!--
    Let us know about other solutions you've tried or researched.
  -->
  
  I've been extending the `ImageRenditionField` for use in my own projects
  
  ### Additional context
  
  <!--
    Is there anything else you can add about the proposal?
    You might want to link to related issues here, if you haven't already.
  -->
  
  (Write your answer here.)
  
  Use Full URL for ImageRenditionField.
  ### Is your proposal related to a problem?
  
  <!--
    Provide a clear and concise description of what the problem is.
    For example, "I'm always frustrated when..."
  -->
  
  I'm a big fan of the new `full_url` field that images have and would like them to be easily used in the API.
  
  Assuming one's frontend app is living on a different domain to the Wagtail API then the default relative URLs aren't as useful.
  
  ### Describe the solution you'd like
  
  <!--
    Provide a clear and concise description of what you want to happen.
  -->
  
  Add `full_url` to the output of `ImageRenditionField`.
  
  I propose it just replace the `url` field altogether, but both could be returned.
  
  ### Describe alternatives you've considered
  
  <!--
    Let us know about other solutions you've tried or researched.
  -->
  
  I've been extending the `ImageRenditionField` for use in my own projects
  
  ### Additional context
  
  <!--
    Is there anything else you can add about the proposal?
    You might want to link to related issues here, if you haven't already.
  -->
  
  (Write your answer here.)
  
  
  </issue>
  <code>
  [start of wagtail/images/api/fields.py]
  1 from collections import OrderedDict
  2 
  3 from rest_framework.fields import Field
  4 
  5 from ..models import SourceImageIOError
  6 
  7 
  8 class ImageRenditionField(Field):
  9     """
  10     A field that generates a rendition with the specified filter spec, and serialises
  11     details of that rendition.
  12 
  13     Example:
  14     "thumbnail": {
  15         "url": "/media/images/myimage.max-165x165.jpg",
  16         "width": 165,
  17         "height": 100,
  18         "alt": "Image alt text"
  19     }
  20 
  21     If there is an error with the source image. The dict will only contain a single
  22     key, "error", indicating this error:
  23 
  24     "thumbnail": {
  25         "error": "SourceImageIOError"
  26     }
  27     """
  28 
  29     def __init__(self, filter_spec, *args, **kwargs):
  30         self.filter_spec = filter_spec
  31         super().__init__(*args, **kwargs)
  32 
  33     def to_representation(self, image):
  34         try:
  35             thumbnail = image.get_rendition(self.filter_spec)
  36 
  37             return OrderedDict(
  38                 [
  39                     ("url", thumbnail.url),
  40                     ("width", thumbnail.width),
  41                     ("height", thumbnail.height),
  42                     ("alt", thumbnail.alt),
  43                 ]
  44             )
  45         except SourceImageIOError:
  46             return OrderedDict(
  47                 [
  48                     ("error", "SourceImageIOError"),
  49                 ]
  50             )
  51
  [end of wagtail/images/api/fields.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/wagtail/images/api/fields.py b/wagtail/images/api/fields.py
  --- a/wagtail/images/api/fields.py
  +++ b/wagtail/images/api/fields.py
  @@ -13,6 +13,7 @@
       Example:
       "thumbnail": {
           "url": "/media/images/myimage.max-165x165.jpg",
  +        "full_url": "https://media.example.com/media/images/myimage.max-165x165.jpg",
           "width": 165,
           "height": 100,
           "alt": "Image alt text"
  @@ -37,6 +38,7 @@
               return OrderedDict(
                   [
                       ("url", thumbnail.url),
  +                    ("full_url", thumbnail.full_url),
                       ("width", thumbnail.width),
                       ("height", thumbnail.height),
                       ("alt", thumbnail.alt),
  
verification_info: {"golden_diff": "diff --git a/wagtail/images/api/fields.py b/wagtail/images/api/fields.py\n--- a/wagtail/images/api/fields.py\n+++ b/wagtail/images/api/fields.py\n@@ -13,6 +13,7 @@\n     Example:\n     \"thumbnail\": {\n         \"url\": \"/media/images/myimage.max-165x165.jpg\",\n+        \"full_url\": \"https://media.example.com/media/images/myimage.max-165x165.jpg\",\n         \"width\": 165,\n         \"height\": 100,\n         \"alt\": \"Image alt text\"\n@@ -37,6 +38,7 @@\n             return OrderedDict(\n                 [\n                     (\"url\", thumbnail.url),\n+                    (\"full_url\", thumbnail.full_url),\n                     (\"width\", thumbnail.width),\n                     (\"height\", thumbnail.height),\n                     (\"alt\", thumbnail.alt),\n", "issue": "Use Full URL for ImageRenditionField.\n### Is your proposal related to a problem?\r\n\r\n<!--\r\n  Provide a clear and concise description of what the problem is.\r\n  For example, \"I'm always frustrated when...\"\r\n-->\r\n\r\nI'm a big fan of the new `full_url` field that images have and would like them to be easily used in the API.\r\n\r\nAssuming one's frontend app is living on a different domain to the Wagtail API then the default relative URLs aren't as useful.\r\n\r\n### Describe the solution you'd like\r\n\r\n<!--\r\n  Provide a clear and concise description of what you want to happen.\r\n-->\r\n\r\nAdd `full_url` to the output of `ImageRenditionField`.\r\n\r\nI propose it just replace the `url` field altogether, but both could be returned.\r\n\r\n### Describe alternatives you've considered\r\n\r\n<!--\r\n  Let us know about other solutions you've tried or researched.\r\n-->\r\n\r\nI've been extending the `ImageRenditionField` for use in my own projects\r\n\r\n### Additional context\r\n\r\n<!--\r\n  Is there anything else you can add about the proposal?\r\n  You might want to link to related issues here, if you haven't already.\r\n-->\r\n\r\n(Write your answer here.)\r\n\nUse Full URL for ImageRenditionField.\n### Is your proposal related to a problem?\r\n\r\n<!--\r\n  Provide a clear and concise description of what the problem is.\r\n  For example, \"I'm always frustrated when...\"\r\n-->\r\n\r\nI'm a big fan of the new `full_url` field that images have and would like them to be easily used in the API.\r\n\r\nAssuming one's frontend app is living on a different domain to the Wagtail API then the default relative URLs aren't as useful.\r\n\r\n### Describe the solution you'd like\r\n\r\n<!--\r\n  Provide a clear and concise description of what you want to happen.\r\n-->\r\n\r\nAdd `full_url` to the output of `ImageRenditionField`.\r\n\r\nI propose it just replace the `url` field altogether, but both could be returned.\r\n\r\n### Describe alternatives you've considered\r\n\r\n<!--\r\n  Let us know about other solutions you've tried or researched.\r\n-->\r\n\r\nI've been extending the `ImageRenditionField` for use in my own projects\r\n\r\n### Additional context\r\n\r\n<!--\r\n  Is there anything else you can add about the proposal?\r\n  You might want to link to related issues here, if you haven't already.\r\n-->\r\n\r\n(Write your answer here.)\r\n\n", "before_files": [{"content": "from collections import OrderedDict\n\nfrom rest_framework.fields import Field\n\nfrom ..models import SourceImageIOError\n\n\nclass ImageRenditionField(Field):\n    \"\"\"\n    A field that generates a rendition with the specified filter spec, and serialises\n    details of that rendition.\n\n    Example:\n    \"thumbnail\": {\n        \"url\": \"/media/images/myimage.max-165x165.jpg\",\n        \"width\": 165,\n        \"height\": 100,\n        \"alt\": \"Image alt text\"\n    }\n\n    If there is an error with the source image. The dict will only contain a single\n    key, \"error\", indicating this error:\n\n    \"thumbnail\": {\n        \"error\": \"SourceImageIOError\"\n    }\n    \"\"\"\n\n    def __init__(self, filter_spec, *args, **kwargs):\n        self.filter_spec = filter_spec\n        super().__init__(*args, **kwargs)\n\n    def to_representation(self, image):\n        try:\n            thumbnail = image.get_rendition(self.filter_spec)\n\n            return OrderedDict(\n                [\n                    (\"url\", thumbnail.url),\n                    (\"width\", thumbnail.width),\n                    (\"height\", thumbnail.height),\n                    (\"alt\", thumbnail.alt),\n                ]\n            )\n        except SourceImageIOError:\n            return OrderedDict(\n                [\n                    (\"error\", \"SourceImageIOError\"),\n                ]\n            )\n", "path": "wagtail/images/api/fields.py"}]}